Restore SharePoint Site Collection using Restore-SPSite Fails with No Content Databases are Available

Attempting to restore a site collection using the powershell Restore-SPSite cmdlet failed with the following error

Restore-SPSite -identity http://sp2010/sites/XXX -path e:\backups\newport.bak
Restore-SPSite : No content databases are available for this operation but the site collection is scheduled for deletion in at least one content database.  Either wait for the deletion operation to complete or  create a content database, and then try the operation again. To create a content database, click "Content databases" on the Application Management page, select the Web application to use, and then click "Add  a content database". At line:1 char:15 
+ Restore-SPSite <<<<  http://sp2010/sites/XXX -path e:\backups\newport.bak
    + CategoryInfo          : InvalidData: (Microsoft.Share...dletRestoreSite:SPCmdletRestoreSite) [Restore-SPSite], InvalidOperationException 
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite

I had previously deleted the site collection using Central Administration, and in this case I was trying to copy the site collection between virtual machines.

Deleting the site collection in Central Administration used the gradual delete method which left the site collection GUIDs behind in the content database, which caused the restore to fail.

To resolve this I manually ran the Gradual Site Delete timerjob, after this finished I was then able to restore the site collection normally.

Gradual Site Delete Timerjob
Gradual Site Delete Timerjob

Published by

Phil Harding

SharePoint Consultant, Developer, Father, Husband and Climber.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.