SharePoint 2013: Site Collection cannot be Restored due to Insufficient Space
Problem Definition
We get error "Site collection could not be restored. Make sure the content databases are available and have sufficient space" when try to restore site collection from a backup
Steps to recreate the issue
I observed this issue in below scenarios:
Scenario 1
- A user takes a backup of a site collection.
- Creates a new blank site collection in same web Application(content database).
- Tried to restore it the backup to this site collection
Scenario 2
- A user takes a backup of a site collection and then deletes site collection from central admin.
- Creates a new blank site collection in same web Application(content database).
- Tried to restore it the backup to this site collection
Cause
There are 2 causes to this issue:
- Site is marked to be restored in future using Restore-SPDeletedSite command. When a site collection is deleted. It can be restored with same Site ID and content without any backup. You just need to restore it using Restore-SPDeletedSite and delete sites SiteID
- Timerjob : Gradual Site Delete. "When a site collection is deleted, the site collection entry (pointer) in dbo.SiteMap is removed from the configuration database and from dbo.Sites in the corresponding content database. For all purposes of user access to the site collection Url or its content the site collection no longer exists and is inaccessible, or otherwise, the Url is no longer reserved. The site collection deletion is then queued into a new table (dbo.SiteDeletion) in the hosting content database where it is marked to be gradually deleted. At this point in the operation, a new Timer Job Definition [Gradual Site Delete] executes on a daily schedule [configurable], and will continuously attempt to delete all the data for all the site collections in its queue (dbo.SiteDeletion). It will delete the data in small enough batches of a maximum of 1000 rows through multiple transactions to avoid lock escalation, and can be resumed in the event any failure occurs so that it can attempt the delete process again if needed. Once the site collection is fully deleted the dbo.SiteDeletion entry is removed." [Bill Baer, MS]
Resolutions
- Create a new database from Central Admin.
- Go to Central Admin > Application Management
- Manage Content databases.
- Add a content database.
- Add a new content database name and click OK.
Note: Make sure that the new blank site collection is created in new content database. Now you will be able to restore site collection in this new database.
- Use Remove-spdeletedsite.
-
- Open Powershell and run get-spdeletedsite. You will see your site collection here with Site ID
-
- Now delete the site collection using this site ID “remove-spdeletedsite f5f7639d-536f-4f76-8f94-57834d177a99”
-
- Now you should be able to restore site collection in same database.
Mitigation
Wait for sometime while the timerjob "Gradual Site Delete" delete all reference from all databases and table before site collection is restored.
References
- http://social.technet.microsoft.com/Forums/sharepoint/en-US/548a6966-8d8b-4b6c-8b82-485d0d4d634d/site-collection-could-not-be-restored-make-sure-the-content-databases-are-available-and-have?forum=sharepointgeneralprevious#7a3e5fd4-670a-4cd3-9b14-87d483feb4d4
- http://blogs.technet.com/b/wbaer/archive/2010/08/02/gradual-site-delete-in-sharepoint-2010.aspx