Pregunta

I ran Restore-SPSite on my server from a backup. I then deleted the site collection and did it again but got the following error:

Restore-SPSite : The operation that you are attempting to perform cannot be completed successfully. No content databases in the web application were available to store your site collection. The existing content databases may have reached the maximum number of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create another content database for the Web application and then try the operation again.

This is because the same GUID is used twice in the content database. The way round this is to create a new content database.

What happends if I don't want to do that? What can I do? Is there any way I can force it in? Can I change the GUID and reeport import?

¿Fue útil?

Solución

This is a known issue[citation needed] and unfortunately restoring to a new content database is the only workaround (I refuse to call it a solution since you now have a new problem). Once restored, you can't move the site back either; the error it returns is about how the site used to exist in the content database.

If you can, avoid deleting site collections you intend on restoring again later. Use the -force parameter with Restore-SPSite or the -overwrite parameter with stsadm -o restore

Otros consejos

When you delete a Site Collection, it will still remain in the Content database until the "Gradual Site Delete" Timer job is run (by default, it runs once daily). So, once you delete the site collection and run the timer job, then you can again restore the same site collection in the same content database.

Sorry to resurrect such an old thread however I ran into a similar problem today and this http://reality-tech.com/2012/04/04/gradual-site-collection-deletion/ post put me onto the solution. This meant I didn't have to install to a different content database which would have been a big headache for us. Hopefully this might help someone in the future...

The cause is the site collection was deleted from the GUI. This causes (insert AAAARGH Microsoft here) the site to be deleted using the gradual delete parameter. Gradual delete means the site is not really deleted from the content database, it is, as the name implies, gradually deleted by a timer job that runs daily. This is done so if it is accidentally deleted (deleting without backing up is bad anyways) it can be recovered. The only way to permanently delete without gradual delete is using powershell and the delete-spsite command. If you are already in a state where you deleted from the GUI, you need to use the Remove-SPDeletedSite command to delete the site before you can recreate it again. You can use Get-SPDeletedSite to see the sites in such a state, then delete them using Remove-SPDeletedSite -Identity and using either the GUID or URL.

I ran into the same issue. This worked for me:

Add a new content database in CA, to the same Web Application.

run this PowerShell command:

restore-spsite -identity URL -force -DatabaseServer NAME -DatabaseName NEW_DB

this will target the fresh, empty DB for your restore process! after that, you can move your other site collections to the new DB and delete the old one, if you wish.

Licenciado bajo: CC-BY-SA con atribución
scroll top