Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 9 down vote accepted

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

share|improve this answer
    
I'm using the -overwrite parameter, however I get the same error. –  PeterX Mar 18 at 1:43
    
Are you receiving the error after deleting the site collection? Are you trying to restore a site collection over an existing site collection that has never been deleted? –  shufler Mar 18 at 13:13
    
The latter - an overwrite. –  PeterX Mar 19 at 23:06
    
@PeterX I think you may have a different issue.The bug I've described happens when you delete a site collection and then attempt to restore it. –  shufler Mar 19 at 23:15
    
Perhaps, same error message though. –  PeterX Mar 19 at 23:56

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.

share|improve this answer
    
Just to add to this answer. There are some rare situation (usually related to backup/restore operations) where even the timer job won't help. If this is the case, you may resort to the SPContentDatabase.ForceDeleteSite method (link for 2013 version, available also on older vers). –  SPArchaeologist Dec 19 '12 at 8:50

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...

share|improve this answer
1  
Don't apologise, resurrecting old posts with new information is part of the point! I'm not clear, though it sounds like the steps in that post show how to remove a deleted site permanently so Restore-SPSite of the site will work again. Is this the case? –  shufler Aug 23 '12 at 21:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.