Restore a site collection in SharePoint Server 2010

 

Aplica-se a: SharePoint Foundation 2010, SharePoint Server 2010

Tópico modificado em: 2011-11-14

You can use only Windows PowerShell to restore a site collection.

Importante

The SharePoint 2010 Service Pack 1 (SP1) upgrade process alters the schema of all content databases. Because of these changes, you might need to take additional steps to restore a backup that you made before the farm was upgraded to SP1 to the farm after it is upgraded to SP1. For more information about doing this, see Restaurar backups pré-SP1 para um farm SP1 (SharePoint Server 2010).

Use Windows PowerShell to restore a site collection in SharePoint

You can use Windows PowerShell to restore a site collection manually or as part of a script that can be run at scheduled intervals.

Observação

If a user has taken copies of content for off-line editing in Microsoft SharePoint Workspace 2010 and the content is restored from a backup on the server, when the user re-connects, the server automatically synchronizes the off-line content with the restored content. This might result in data loss on the user's copies of the content.

To restore a site collection by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: Consulte Add-SPShellAdmin. Additionally, verify that the user account performing this procedure has read permissions to the backup folder and is a member of the db_owner fixed database role on both the farm configuration database and the content database where the site collection is being restored.

  2. On the Start menu, click All Programs.

  3. Click Microsoft SharePoint 2010 Products.

  4. Click SharePoint 2010 Management Shell.

  5. At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:

    Restore-SPSite -Identity <Site collection URL> -Path <Backup file> [-DatabaseServer <Database server name>] [-DatabaseName <Content database name>] [-HostHeader <Host header>] [-Force] [-GradualDelete] [-Verbose]

    If you want to restore the site collection to a specific content database, use the DatabaseServer and DatabaseName parameters to specify the content database. If you do not specify a content database, the site collection will be restored to a content database chosen by Microsoft SharePoint Server 2010.

    If you are restoring a host-named site collection, use the Identity parameter to specify the URL of the host-named site collection and use the HostHeader parameter to specify the URL of the Web application that will hold the host-named site collection.

    If you want to overwrite an existing site collection, use the Force parameter.

    Observação

    If the site collection that you are restoring is 1 gigabyte or larger, you can use the GradualDelete parameter for better performance during the restore process. When this parameter is used, the site collection that is overwritten is marked as deleted, which immediately prevents any additional access to its content. The data in the marked site collection is then deleted gradually over time by a timer job instead of all at the same time, which reduces the impact on server performance.

For more information, see Restore-SPSite.

Observação

Recomendamos que você use o Windows PowerShell ao executar tarefas administrativas de linha de comando. A ferramenta de linha de comando Stsadm está obsoleta, mas está incluída para oferecer suporte à compatibilidade com versões anteriores do produto.

See Also

Concepts

Fazer backup de um conjunto de sites (SharePoint Server 2010)