Partilhar via


Copy configuration settings between farms (SharePoint Server 2010)

 

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

Tópico modificado em: 2014-10-20

This article describes how to copy configuration settings from one Microsoft SharePoint Server 2010 farm to another SharePoint Server 2010 farm. Copying the configuration settings of one farm to another can be useful in the following circumstances:

  • Setting up similar development, test, and production environments.

  • Establishing an organization standard for farm configuration settings.

  • Setting up a disaster recovery environment.

In this article:

  • Back up and recover a farm without content databases to copy configuration settings in SharePoint

  • Back up and recover configuration settings only

  • Create a scripted deployment to copy configuration settings in SharePoint

There are many ways in which you can copy configurations from one farm to another. Determine which method to use based on the configuration settings that you want to copy and how often you have to copy them.

  • Back up and recover a farm without the content databases attached. This method provides you with farm settings and Web application settings, in addition to the settings for any service applications that you select.

  • Back up and recover configurations only. This method provides you with the core SharePoint Foundation 2010 settings only.

    Observação

    This method does not include Web application or service application settings. If Web application settings are required in the recovered farm, use one of the other methods.

  • Create a deployment script, based on your documented configuration. This method may be more work at first, but is easy to use to maintain standardization.

Back up and recover a farm without content databases to copy configuration settings in SharePoint

To copy configuration settings by using a farm backup, we recommend that you first detach the content databases from the farm. This is not a step that we recommend that you take with a live production farm.

Observação

Creating a farm backup without content databases does back up the service applications.

To back up and recover a farm without content databases by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: Consulte Add-SPShellAdmin.

  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, type the following command to document the current Web application URLs and content database mappings.

    Get-SPWebApplication | %{$_.Name;$_.Url;%{$_.ContentDatabases|%{$_.Name};Write-Host ""}}
    
  6. Either unmount all content databases, as in the following example:

    Get-SPContentDatabase | Dismount-SPContentDatabase
    

    Or unmount a specific content database, as in the following example:

    Get-SPContentDatabase WSS_Content | Dismount-SPContentDatabase
    
  7. Back up the farm.

    Backup-SPFarm -Directory \\servername\share -BackupMethod Full
    

    Observação

    You can view the progress of the backup by looking at the \servername\share\spbr####\spbackup.log file.

  8. After the backup is complete, re-mount the content databases. Replace <WSS_Content> and <https://servername> with each of the mappings documented in step 1).

    Mount-SPContentDatabase -Name <WSS_Content> -WebApplication <https://servername>
    

Back up and recover configuration settings only

As part of farm backup, you can choose to back up only configuration settings. A configuration-only backup extracts and backs up many, but not all, configuration settings from a configuration database. By using built-in tools, you can back up the configuration of any configuration database, whether it is currently attached to a farm or not. For detailed information about how to back up a configuration, see Back up a farm configuration in SharePoint Server 2010.A configuration backup can be restored to the same — or any other — server farm. When a configuration is restored, it will overwrite any settings present in the farm that have values that are set within the configuration backup. If any settings present in the farm are not contained in the configuration backup, they will not be overwritten. For detailed information about how to restore a farm configuration, see Restore a farm configuration in SharePoint Server 2010.

Create a scripted deployment to copy configuration settings in SharePoint

When you create a scripted deployment of SharePoint Server 2010, you are creating copies of configuration settings. For more information, see Instalar o SharePoint Server 2010 usando o Windows PowerShell.