Restore a Site Collection

Follow these steps:

  1. Recover the site collection content from an unattached content database.
  2. From Central Administration

    1. Select the Backup site collection option, and click the Next button.
    2. Select the site collection and provide the file location for the backup package.
    3. Select Overwrite existing file.
    4. Click the Start Backup button to begin the backup.
    5. The site collection is backed up to a file.

    Use PowerShell commands

    1. $database = Get-SPContentDatabase -ConnectAsUnattachedDatabase -DatabaseName xxxx -DatabaseServer xxxx
    2. ConnectAsUnattachedDatabase: Specifies that only unattached databases in the farm are returned.
    3. DatabaseName: Specifies the name of the content database.
    4. DatabaseServer: Specifies the name of the host server for the content database specified in the DatabaseName parameter.
    5. For more information, see the article from Microsoft.
    6. Backup-SPSite -Identity xxxx -Path xxxx
    7. Identity: Specifies the URL or GUID of the site collection to be backed up.
    8. Path: Specifies the full path of the backup file (Example, C:\backup\sitecollection.bak).
    9. For more information, see the article from Microsoft.
  3. Click SharePoint Management Shell to launch the console.
  4. Use PowerShell commands to restore the site collection.
  5. Restore-SPSite -Identity xxxx -Path xxxx

  6. Identity: Specifies the URL location to which the Site Collection is restored. (For example, http://www.contoso.com)
  7. Path: Specifies a valid path of the backup location.(For example, C:\backup\sitecollection.bak)
  8. For more information, see the article from Microsoft.
  9. Note:Restoring a site collection to its original location will fail. You can perform the following steps:
    1. New-SPContentDatabase -Name xxxx -DatabaseServer xxxx -WebApplication xxxx
    2. Name: Specifies the new content database to create within the farm.
    3. DatabaseServer: Specifies the name of the host server for the content database specified in the Name parameter.
    4. WebApplication: Attaches the content database to the specified SharePoint Web application.
    5. Restore-SPSite -Identity xxxx -Path xxxx -GradualDelete -DatabaseServer xxxx -DatabaseName xxxx
    6. Identity: Specifies the URL location to which the Site Collection is restored. (For example, http://www.contoso.com)
    7. Path: Specifies a valid path of the backup location.(Example, C:\backup\sitecollection.bak)
    8. GradualDelete: Specifies that the site collection being overwritten with the Force parameter should be gradually deleted over time by a timer job, instead of deleting all at once. It reduces the impact on SharePoint 2010 Products and SQL Server performance.
    9. DatabaseName: Specifies the SQL Server content database where the site collection data will be stored.
    10. DatabaseServer: Specifies the name of the SQL Server containing the content database specified by the DatabaseName parameter.