Monday, March 4, 2013

Solution> Restore-SPSite : The site collection could not be restored.


The next problem i have got when i tried to replace the backup from a SharePoint Site.

The problem i'v got is "Restore-SPSite : The site collection could not be restored." what you can see in my powershell dump below.

The problem is that in the contentdatabase on the url a site is registered.
You read allot of person the describe to restore a database backup to fix this problem. This is not necessary.

There is a easier way.


This is my powershell dump.
**********************

Windows PowerShell Transcript Start

Start time: 20130228153052

Username  : {COMPUTERNAME}\SPadministrator

Machine  : {COMPUTERNAME} (Microsoft Windows NT 6.1.7601 Service Pack 1)

**********************

Transcript started, output file is siteRestore_2013-02-28_15-30-52.log

Creating site collection: https://backup-spsite.fastlane2.local

Site collection creating. Restoring backup D:\Backup\{COMPUTERNAME}\backup.site to site collection https://backup-spsite.fastlane2.local

Confirm

Are you sure you want to perform this action?

Performing operation "Restore-SPSite" on Target

"https://backup-spsite.fastlane2.local".

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help

(default is "Y"):y

Restore-SPSite : The site collection could not be restored. If this problem per

sists, please make sure the content databases are available and have sufficient

 free space.

At D:\Backup\{COMPUTERNAME}\Restore-FastlaneSite.ps1:50 char:16

+     Restore-SPSite <<<<  -identity $siteUrl -path $restoreFileFullPath -HostH

eaderWebApplication $webApplication -ContentDatabase $contentDatabaseName -forc

e

    + CategoryInfo          : InvalidData: (Microsoft.Share...dletRestoreSite:

   SPCmdletRestoreSite) [Restore-SPSite], SPException

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreS

   ite

Backup D:\Backup\{COMPUTERNAME}\backupsite.site is restored to https://backup-spsite.fastlane2.local

**********************

Windows PowerShell Transcript End

End time: 20130228153056

**********************

The problem is that in the contentdatabase on the url a site is registered.
You read allot of person the describe to restore a database backup to fix this problem. This is not necessary.

Solution:

If you fix the database by the following steps you can restore your backup-spsite on the same url you used before.

Get the database with powershell and the database guid.
GET-SPDatabase (gives a list af content datbases)

$db = Get-SPDatabase 9a96829a-fc28-4ce7-98d3-481297044663

$db.Repair($true)

  

$db.Update();

Restore your backup again

To backup and restore your SharePoint site there are some tools for. One of those tools is the Backup, Archive & Restore tool.

No comments:

Popular Posts