Partilhar via


Restore a site collection (Search Server 2010)

 

Tópico modificado em: 2011-08-08

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

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

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. In the SharePoint 2010 Management Shell, at the Windows PowerShell command prompt, type the following command:

    Restore-SPSite -Identity <SiteCollectionURL> -Path <BackupFile> -DatabaseServer <DatabaseServerName> -DatabaseName <ContentDatabaseName> -HostHeader <HostHeader> -Force -GradualDelete -Verbose
    

    Where:

    • <SiteCollectionURL> is the URL of the site collection that you want to restore.

    • <BackupFile> is the path of the backup that you want to use.

    • <DatabaseServerName> and <ContentDatabaseName> are the specific database server and content database to which you want to restore the site collection. If you do not specify a content database, the site collection will be restored to a content database chosen by Microsoft Search Server 2010.

    • <HostHeader> is the URL of the Web application that will hold the host-named site collection.

    This command uses the Force parameter to overwrite an existing site collection and uses the GradualDelete parameter for better performance during the restore process, which is recommended if the site collection that you are restoring is 1 gigabyte or larger. 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.