31 October 2013

Help! I deleted my root site!

Don't laugh! This happened to a colleague of mine quite recently, and in the past I have seen consultants lose contracts for making this mistake. The last thing you want to be doing is an unscheduled test of the restore process and explaining the finer details of RTO and RPO to your stakeholders... that's a scary thought for Halloween!

Since SharePoint 2010 Service Pack 1, we have had the Site Recycle Bin available to restore accidentally deleted sites. However, to access this you need to go to the root site of the site collection containing the site you deleted. If you deleted the root site itself, this is not possible anymore.

Although it may not be immediately obvious (especially to content owners who don't wade into Central Administration), deleting a root site is essentially the same operation as deleting the entire site collection. The Site Collection Recycle Bin works in both cases.

Using the Site Collection Recycle Bin is pretty easy but it does require PowerShell, and you'll need to either be on SharePoint 2013 or have 2010 with Service Pack 1 installed.

Run Get-SPDeletedSite to get a list of all deleted site collections in the farm.

Then, use the ID of your specific site collection with the Restore-SPDeletedSite command.

Simple!

Note to Microsoft: perhaps the "Delete this site" shouldn't be shown for a root web and we can leave the deletion of site collections to those who can access Central Admin or PowerShell. This would provide a symmetry with the creation of site collections.

Note to SharePoint users: always be careful that you're actually in the site you think you're in before you delete a site!