Question

I am trying to restore a site collection backup from production on the dev site collection. Old dev site collection already exists, but I am trying to overwrite that with the latest copy.

I ran following command

Restore-SPSite "http://mydevsitecollectionpath/" -Path "D:\pathname\12102020.bak" -Force

I am getting 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.
At line:1 char:1
+ Restore-SPSite "http://dev-theloop.legalaid.ab.ca/" -Path "D:\SCS\Loop\backups\l ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...dletRestoreSite:SPCmdletRestoreSite) [Restore-SPSite], I
   nvalidOperationException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite

I checked the lock status and its not locked, Database is not read-only its online and ready, Maximum number of site collections are set to 5000, Current number of site collections are 2.

After some research I have found some answers, which says to create a new content db and restore it on that. But I want to replace the existing one, if it is not possible I would like to know why.

Était-ce utile?

La solution

I’ve just tested with the same command and it works fine.

Try specifying the name of the Database Server and the Content Database in the command and try again:

Restore-SpSite “http://mydevsitecollectionpath/” -Path "D:\pathname\12102020.bak" -Force -DatabaseServer <SQL> -DatabaseName <DB>

Reference: Restore-SpSite : The operation that you are attempting to perform cannot be completed successfully.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top