Friday, September 25, 2015

One problem with Restore-SPSite cmdlet

When you use Restore-SPSite cmdlet for restoring site collection

Restore-SPSite http://example.com/siteB -Path c:/temp/siteA.bak

you may get 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.

image

It may happen when you backuped site collection from the web application (e.g. http://example.com/siteA) and then try to restore it to the same web app using different managed path (e.g. http://example.com/siteB). In order to avoid this error specify DatabaseServer and DatabaseName parameters:

Restore-SPSite http://example.com/siteB -Path c:/temp/siteA.bak -DatabaseServer servername -DatabaseName dbname

Error should disappear after that.

No comments:

Post a Comment