Search In
Hi all,
This topic was already raised in the following thread. I am starting a new one to see if it can generate some interest. I have a problem in my currentinstallation were everytime I try to empty the recycle bin it ends up ADDING nodes instead of deleting. I think I have an issue where the recycle bin hung, I cancelled the process, and now it's messed up.
Does anyone have some tips on how I might be able to manually delete these nodes from the DB? I feel like that is my only opion at this point (other than starting fresh, which is not really an option any longer.
Thank you all.
-- Nik
You know the drill... backup before playing with the database since this is not the "approved" method.
But, since you asked... look for nodes that have -20 in the @path. -20 is the recycle bin.
cheers,doug.
Ah, ok. Should have thought of the 'path'. THanks Doug.
Ok, so if anyone else runs into this issue, herre's the script that I have created to 'delete' everything in the recycle bin. As Doug states above, this is not a sanctioned method so pleae backup all of your datasource(s) before attempting this:
-- Uncomment below to verify the number of nodes returned is the -- same as the number of nodes that is in the Recycle Bin-- select * from umbracoNode where path like '%-20%' and id!=-20-- Delete all 'related' nodes and table contents...delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)-- delete the XML nodes....delete from umbracoNode where path like '%-20%' and id!=-20
I think that recursive T-SQL will be more safe because I have just had situation in which path contains "-20" value but the parent of this node isn't in recycle bin.
So how to update path column? :)
Best regards
@Nik, thank for posting this SQL, it's just solved my issue and saved me having to write it :)
Cheers,
Chris
Maybe a bit too late but isn't it safer and simpler to look for nodes with a parentID = -20 ?
Or am I missing something...
Regards,
Manos
Querying on ParentID = -20 vs path like '%-20%' and id!=-20 came back with different counts for me ???
I also needed to add a delete of the CMSTagRelationship table to the script above:
So mine looks like this:
-- Uncomment below to verify the number of nodes returned is the
-- same as the number of nodes that is in the Recycle Bin
-- select * from umbracoNode where path like '%-20%' and id!=-20
-- Delete all 'related' nodes and table contents...
delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsTagRelationship where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
-- delete the XML nodes....
delete from umbracoNode where path like '%-20%' and id!=-20
Greetings everyone, i had the same problem because i was migrating data from another database to umbraco, but i forgot to delete it permanently. Then in the Recycled bin I had like 6000 items. I tried the script that left Nik, but i had to do some changes, a i leave it :
delete from cmsPreviewXml where versionID in (select versionid from cmsContentVersion where ContentId in (select nodeId from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)))delete from cmsContentVersion where ContentId in (select nodeid from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20))delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsContentXML where nodeId in (select nodeid from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20))delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)delete from umbracoNode where path like '%-20%' and id!=-20/*select * from cmsDocumentType where contentTypeNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)select * from cmsDataType where nodeid in (select id from umbracoNode where path like '%-20%' and id!=-20)select * from umbracoUser2NodePermission where nodeid in (select id from umbracoNode where path like '%-20%' and id!=-20)*/
By the way, it worked because i did not use tags,relations,members and permissions with the nodes.
Jorge
I executed the script of Dave, everything executes well, but on the last line I get an error message saying:
The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode".
Any ideas?
My recycle bin is still not empty, because the last line won't execute I suppose?...
grts,
Kim
I have the same issue as kim any help?