Previous Topic: Restore using Mount Database from Recovery PointNext Topic: Restore a Site


Restore a Site Collection

Follow these steps:

  1. Recover the site collection content from an unattached content database.
    1. $database = Get-SPContentDatabase -ConnectAsUnattachedDatabase -DatabaseName xxxx -DatabaseServer xxxx

      ConnectAsUnattachedDatabase: Specifies that only unattached databases in the farm are returned.

      DatabaseName: Specifies the name of the content database.

      DatabaseServer: Specifies the name of the host server for the content database specified in the DatabaseName parameter.

      For more information, see the article from Microsoft.

    2. Backup-SPSite -Identity xxxx -Path xxxx

      Identity: Specifies the URL or GUID of the site collection to be backed up.

      Path: Specifies the full path of the backup file (Example, C:\backup\sitecollection.bak).

      For more information, see the article from Microsoft.

  2. Click SharePoint Management Shell to launch the console.
  3. Use PowerShell commands to restore the site collection.
    Restore-SPSite -Identity xxxx -Path xxxx
    

    Identity: Specifies the URL location to which the Site Collection is restored. (For example, http://www.contoso.com)

    Path: Specifies a valid path of the backup location.(For example, C:\backup\sitecollection.bak)

    For more information, see the article from Microsoft.

    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

      Name: Specifies the new content database to create within the farm.

      DatabaseServer: Specifies the name of the host server for the content database specified in the Name parameter.

      WebApplication: Attaches the content database to the specified SharePoint Web application.

    2. Restore-SPSite -Identity xxxx -Path xxxx -GradualDelete -DatabaseServer xxxx -DatabaseName xxxx

      Identity: Specifies the URL location to which the Site Collection is restored. (For example, http://www.contoso.com)

      Path: Specifies a valid path of the backup location.(Example, C:\backup\sitecollection.bak)

      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.

      DatabaseName: Specifies the SQL Server content database where the site collection data will be stored.

      DatabaseServer: Specifies the name of the SQL Server containing the content database specified by the DatabaseName parameter.