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.

Published by