SQL Query to empty child portal recycle bins?
Last Post 12/21/2016 6:45 AM by Andy Stephenson DNN Creative. 4 Replies.
Author Messages
Ezara Penning
Nuke Newbie
Nuke Newbie
Posts:9


--
05/26/2009 10:28 AM  
I have a DNN website with 107 child portals (most of these child portals are faculty website that simply have a home page with their office hours listed).

One of the things I frequently come across are recycle bins filled with deleted modules and pages.

I would like to be able to run a SQL query to delete the contents of the recycle bins rather than logging into each site and manually dumping them.

Can this be done?

Thanks in advance!

Ezara
Joseph Craig
DNN MVP
Posts:11667


--
05/26/2009 6:53 PM  
You'd have do go into several different tables to do it. There's nothing canned that I know of.

Joe Craig, Patapsco Research Group
Complete DNN Support
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
05/31/2009 2:13 AM  
Do you think it would be possible to find out the SQL procedure that is executed for deleting the Recycle bin + then execute the SQL procedure? This may take care of the mulitple tables problem? - That would be where I would start investigating, thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
stephen conard
Nuke Newbie
Nuke Newbie
Posts:1


--
12/20/2016 2:18 PM  
Some of us are still tied to the old versions of dnn. The one I pulled this from is actually 4.8.

/*deleteSearchItemsOfDeletedPageModules*/
delete from searchItem where moduleId in
(SELECT Modules.ModuleID
FROM Modules INNER JOIN
TabModules ON Modules.ModuleID = TabModules.ModuleID INNER JOIN
Tabs ON TabModules.TabID = Tabs.TabID
where tabs.isdeleted = 1)

/*deleteModulesFromDeletedPages*/
delete from modules where moduleid in
(SELECT Modules.ModuleID
FROM Modules INNER JOIN
TabModules ON Modules.ModuleID = TabModules.ModuleID INNER JOIN
Tabs ON TabModules.TabID = Tabs.TabID
where tabs.isdeleted = 1)

/*deletePagesMarkedForDeletion*/
delete from tabs where tabs.isdeleted = 1

/*deleteSearchItemsOfDeletedModules*/
delete from searchItem where moduleId in
(SELECT Modules.ModuleID
FROM Modules
where Modules.isdeleted = 1)

/*deleteModulesMarkedForDeletion*/
delete from modules where isdeleted = 1



Hope it helps someone.

Andy Stephenson DNN Creative
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:169


--
12/21/2016 6:45 AM  
Thank you!

Andy


---