Bluedog Limited > SharePoint Thoughts > Posts > SPDeletedSite - quick overview of SP1’s improved recycle bin
June 28
SPDeletedSite - quick overview of SP1’s improved recycle bin

With the release of SharePoint 2010 SP1, admins now have the opportunity to work with an improved recycle bin.  Sites and site collections can now be recovered if they have been deleted via the SharePoint browser interface. 

Site Recycle Bin

Service Pack 1 will introduce long awaited Site Recycle Bin functionality that enables self-service recovery of site collections and sites.   In the past IT Professionals were tasked with restoring entire databases to recover deleted site collections and sites and would generally require expensive restore environments to support the task.  Now in Service Pack 1 administrators can quickly and easily recover site collections and sites accidentally deleted by their owners in a process similar to that of the Recycle Bin we have for Lists, Libraries, and Documents.

(excerpt from SharePoint Team Blog)

How do you get started with recovering your deleted sites?

First, you have to upgrade your databases to SP1.  It is worth calling out this simple fact, because if you don’t you will get an error message that states “Specified method is not supported” when you try to delete a site (funny bug - you can no longer delete sites!). 

image

With your databases upgraded, the next step is to figure out what you want to undelete.  If you have deleted a site and the parent site collection is still up and running, all you need to do is jump over to the Site Collection Recycle Bin.  Your deleted site will appear in the second stage recycle bin (aka “Deleted from end user Recycle Bin”).

image

Pick the site you want to restore and you’re done.  Note that if you try to restore a child of site that has also been deleted, you need to restore the parent first.  In the image above, if you try to restore “/sites/Asta/Parks/GasWorks/sub1” before restoring the parent “/sites/Asta/Parks/GasWorks”, nothing happens.  In fact, you won’t even get an error message – all you will see is a blank page (another funny bug).

 

What about site collections?

If you have deleted a site collection, you no longer have the luxury of going to the Recycle Bin.  You have to switch over to PowerShell.  imageIf you fire up your PowerShell console window, you will find that SharePoint 2010 SP1 has introduced three (3) new commandlets designed to handle deleted site collections.

Unfortunately, the built-in PowerShell documentation for these commandlets are lacking.  You will need to pull down the information from MSDN for the new commandlets.

Command Link
Get-SPDeletedSite http://technet.microsoft.com/en-us/library/hh286316.aspx
Remove-SPDeletedSite http://technet.microsoft.com/en-us/library/hh286317.aspx
Restore-SPDeletedSite http://technet.microsoft.com/en-us/library/hh286319.aspx

 

If you provide no parameters to Get-SPDeletedSite, it will return the list of all deleted site collections.  This is particularly helpful if you happen to have more than 1 site collection with the same server-relative url.

image

Restore-SPDeletedSite will restore the site collection based on the parameters specified.  Finally, Remove-SPDeletedSite will purge the site collection from the recycle bin and thus allowing the site to be scheduled for absolute clean-up via the Gradual Site Delete timer job.

Points worth calling out...

There is a notable difference between these commandlets and others.  The SPDeletedSite commandlets only take server-relative urls.  This is pretty important to call out simply because this is a distinct change in behavior compared to other commands which normally take the full url.

6/29/11 update

NOTE: There is a difference between Remove-SPSite and Remove-SPWeb!

Remove-SPWeb has a new parameter -Recycle that allows an admin to route the deleted SPWeb over to the Recycle Bin.

Remove-SPSite did not change with SP1 and therefore all deletions bypass the Recycle Bin.

Finally, it’s also worth mentioning the SPDeletedSite commandlets only work if you have deleted the site collection via the browser ui or the object model.  If you are an admin and you have explicitly called Remove-SPSite, then your site collection is not available to the SPDeleteSite commandlets. 

-Maurice

Comments

upgrading Sharepoint 2010 content database

I'm having this same issue you described.
How do you perform the update on a content database in 2010.
The usual method of de-attaching and re-attaching the content database is not working. Any suggestions?
 on 6/30/2011 1:04 PM

upgrading Sharepoint 2010 content database

Never Mind, I figured it out. I didn't know I had to run the Configuration Wizard after I ran the update and the server rebooted.
 on 7/1/2011 4:05 PM

Thank You

Thanks! Helped me a lot!

Regards from Germany
 on 7/8/2011 6:53 AM

Great News

SP1 really made easy for all the IT professional to restore their accidently deleted site collections...

Nice feature... Loved it.
 on 8/31/2011 6:17 AM

Remove-SPSite with GradualDelete Switch

If you delete a site collection with Remove-SPSite -GradualDelete, then the site collection shows up in the Get-SPDeletedSites and you can restore it.
 on 1/3/2012 7:07 AM

site collection removal

I deleted a site collection (www.dot.com/site1) and then ran Remove-SPDeletedSite to do a complete removal.  I want to create a subsite (www.dot.com/site1) under / (not a site collection) then import the site collection under this url.

When i go to create a blank site with url www.dot.com/site i continually get an error stating special characters , collation, blah.  I can create sites with other urls.

it looks like the delete will not get rid of the url so i can reuse as a subsite.  help!
 on 2/15/2012 4:36 AM

Re: SPDeletedSite - quick overview of SP1’s improved recycle bin

Site collections can't live under a site.  Also, you might want to check your manage path settings. 
Maurice PratherNo presence information on 2/16/2012 4:26 PM

Thanks

Nice post. Deleted a site coll and was not able to restore the same content db even after the gradual delete has run. This post clearly explained what happens on a site collection deletion with SP1.
 on 5/10/2012 4:09 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


captcha

Please verify the text shown in the image

Attachments


© Bluedog Limited 2004-2012
Aptillon, Inc.
Microsoft Certified Master - SharePoint 2010 & 2007
Sign In