Monday, June 14, 2010

Deleting site collection from User Interface (UI) in SharePoint 2010

I was doing some tests concerning backup/restore a site collection and came across this issue. But before showing the issue, I did the following steps:

1. Took a backup of the site collection using stsadm command:

stsadm -o backup -URL -filename


2. Deleted the site collection from Central Administration site.

When I tried to restore the site collection using stsadm command (MS is trying to deprecate stsadm) stsadm -o backup -URL -filename   I got the following message:






Trired the same thing using Powershell command:

Restore-SPSite -Identity  -Path 


Note that when you try to delete the site collection either from Central Admin or the site's site action menu you get the following message:


So, it looks like by deleting the site via the UI it uses the gradualdelete parameter. So, if we you stsadm command without the gradual delete option
stsadm -o deletesite -URL
Or Powershell command:
Remove-SPSite -Identity 


The site collection will be deleted instantly without waiting for the timer job (Technet has a good article describing the gradual deleting timer job) to gradually deleting the site.

In my scenario it took a lot of time for the timer job to delete the site (deleting the site from the UI) in my case it took hours for OOTB site restoration (i left the site overnight and I was able to restore the site the next morning)


In short, if you are trying to delete the site from the UI and restore it again to the same farm and same content database, it will take a lot of time since UI by default will use the gradualdelete parameter or you could create/add a new content database and restore the site to the newly created/added database (Note: make sure to take the database offline before restoring the site to the newly created/added database).

No comments:

Post a Comment