SharePoint 2010: SP1 Site Collection Recycle Bin

SharePoint 2010: SP1 Site Collection Recycle Bin

SharePoint 2010 SP1 introduces 'deluxe' version of recycle bin feature both at web and site collection level. 
It's no longer necessary to deploy SharePoint Site Recycle bin from http://governance.codeplex.com/ to save site (internally it does a backup) before the deletion.

 

How to use and how it works

When a site collection is deleted it is not destroyed from content database but it is flagged as 'recyclable'. The new site collection recycle bin feature is driven off a new table SiteDeletion located in the content database and a couple of columns (InDeletion and Restorable) used to manage the status of site collection.

Just after the site collection is deleted, the flags are set to InDeleted = 0 and Restorable = 1
Unlike web recycle bin that could be managed direcly from site collection with SharePoint UI, to manage site collection recycle bin is necessary switch to Powershell.
Starting from SP1 there are three new Powershell commands:

After executing Remove-SPDeletedSite command, the site collection is still present on content database but flags on SiteDetetion table assume new value InDeletion = 0 and Restorable = 0. Site clean up is executed in async by Gradual Site Deletion timer job, that performs the physical deletion. Every web application has a dedicated timer job for clean-up activities that can be scheduled in appropriate way. The default schedule executes the job only during the night.
So when the timer job runs it changes the status of InDeletion flag to 1, then both site collection and row on SiteDeletion table are physically deleted.

Both remove and restore commands use identity parameter to identify site collection. The identity could be a GUID or server relative path of the site collection (not full path as the other commands). Personally I prefer to use GUID, of course because it does not give any chance of mistakes.

Note that site collections do not live forever in this state.  The Gradual Site Deletion timer job will mark them for physical deletion when the time for the web applications first stage recycle bin is reached (The default is 30 days).

Leave a Comment
  • Please add 4 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Gokan Ozcifci edited Revision 4. Comment: content formatting and tag  

  • Richard Mueller edited Revision 3. Comment: Removed (en-US) from title, added tag

  • Craig Lussier edited Original. Comment: added en-US to tags and title

Page 1 of 1 (3 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Oe, Euh, I have no words to say.. Great Article.. Realy great

  • Craig Lussier edited Original. Comment: added en-US to tags and title

  • Richard Mueller edited Revision 3. Comment: Removed (en-US) from title, added tag

  • Gokan Ozcifci edited Revision 4. Comment: content formatting and tag  

Page 1 of 1 (4 items)