Saturday, May 27, 2017

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

Error: "The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space"

Before doing anything we just need to check below points...

  1. We need to ensure that content database has enough space.
  2. Are we going to store SP Site on same Content DB
  3. Are we doing Restore first time.  

When we are trying to restore a SP Site over SharePoint Web Application ( On same Content DB ) where SP Sites already exists.  And to resolve this, please follow below steps :

Step 1: Create new Content database, We can create Content Database using below Power shell script

add-pssnapin "Microsoft.SharePoint.powershell" -erroraction silentlycontinue

$User = "sa"
$PWord = ConvertTo-SecureString -String "Your Password" -AsPlainText -Force
$Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $PWord

New-SPContentDatabase "WSS_Content_New" -DatabaseServer "DatabaseServerName" -WebApplication http://WepApplicationUrl/ 
 -DatabaseCredentials $Credential

OR We can just go to Central Administration → Application Management→ Manage content database → Click Add a content database

Step 2 :  Once the Content DB has been created, now restore SP Site in new Content DB, I have done through Power shell script.

Restore-SPSite http://WepApplicationUrl/sites/siteUrl  -Path C:\FilePath\BackupFileName.bak -Force 
-DatabaseServer "DatabaseServerName" -DatabaseName "WSS_Content_New"

That’s all we need to do when when site is already exists in Content Database. But if we re-storing
SP Site first time and still we are getting above error !! This is because SharePoint internally creates orphaned sites entry into Content DB and to resolve this issue there may be many solutions but I am following below,  we can use any below solution...

Solution 1: Run below Power shell script...

add-pssnapin 'microsoft.sharepoint.powershell' -erroraction silentlycontinue
$db = Get-SPDatabase "Your Content Database Name";

Solution 2: We can use below STSADM command...

stsadm -o databaserepair -url "http://WebApplicationUrl" -databasename "Content DB Name" -deletecorruption

Thanks for reading this article and suggest if I am missing anything.


  1. I strongly believe that there will be great opportunities for those who looked into this area, thanks much for creating and sharing here keep updating us...
    Best Online Software Training Institute | Selenium Training


  2. Very nice post here and thanks for it .I always like and such a super contents of these post.

    CEH Training In Hyderbad


SharePoint Deployment Error : The specified path, file name, or both are too long.

Hi, Sometimes we get surprised with below error while deploying wsp file... Solution : To overcome with this issue, we just ne...