Udostępnij za pośrednictwem


Back up search in SharePoint Server 2010

 

Applies to: SharePoint Server 2010

We recommend that you regularly back up at the farm level. However, business or IT requirements might require you to back up the Search service applications and related resources.

Regularly backing up the search system reduces the possibility of data losses that might occur from hardware failures, power outages, or other problems. It is a simple process that helps guarantee that data and configurations that compose the search system are available for recovery, if that is required.

Backing up search does not affect the state of the farm. However, it does require resources. Therefore, backing up search might affect farm performance while the backup is running. You can avoid performance issues by backing up search during hours when farm use is lowest.

Important

Use the procedures in this article to back up the search components of Microsoft SharePoint Server 2010. If the topology includes Microsoft FAST Search Server 2010 for SharePoint, the procedures in this article also back up the Content Search Service Application (SSA) and Query SSA (including the People Search index). However, in addition to the procedures in this article, you must run a backup of the FAST Search Server 2010 for SharePoint farm. For more information, see Backup and restore (FAST Search Server 2010 for SharePoint).

In this article:

  • To back up search by using Windows PowerShell

  • To back up search by using Central Administration

  • Use SQL Server tools to back up search

Task requirements

Before you begin, you must create a local folder or a network folder in which to store the backups. For better performance, we recommend that you back up to a local folder and then move the backup files to a network folder. For more information about how to create a backup folder, see Prepare to back up and recover (SharePoint Server 2010).

The credentials for the default content access accounts and crawl rules are encrypted and cannot be decrypted automatically when restoring on a different farm. However, you can re-encrypt credentials for the default content access accounts and crawl rules before you back up the Search service application. Then you can decrypt the credentials after you restore the Search service application.

Before you back up the Search service application, at the Windows PowerShell command prompt, type the following command:

$ssa = Get-SpenterpriseSearchServiceApplication <SearchServiceApplicationName>
$ssa.SetCrawlAccountMasterKey <Password>

Where:

  • <SearchServiceApplicationName> is the name of the Search service application that you are backing up.

  • <Password> is a strong password that will be used to re-encrypt, and then decrypt, the credentials for the default content access accounts and crawl rules.

You must perform the previous step if you plan to restore or migrate the Search service application to another farm. Even if you are plan to restore the Search service application to the same farm, the previous step is a best practice.

You can use Windows PowerShell to back up search manually or as part of a script that runs at scheduled intervals. This procedure backs up all search components, the databases, the Search service configuration, and all index files.

To back up search by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: See 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:

    Backup-SPFarm -Directory <Backup folder> -BackupMethod {Full | Differential} -Item "Farm\Shared Services\Shared Services Applications\<SearchServiceApplicationName>" [-Verbose]
    

    Note

    If you are backing up the farm for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup. To view the progress of the backup operation, use the Verbose parameter.

    Use the full path of the Search service application.

  6. You must also back up the service application proxy. To do this, at the Windows PowerShell command prompt, type the following command:

    Backup-SPFarm -Directory <Backup folder> -BackupMethod {Full | Differential} -Item "Farm\Shared Services\Shared Services Proxies\<SearchServiceApplicationProxyName>" [-Verbose]
    

    Where:

    • <Backup folder> is the path of the backup folder.

    • <SearchServiceApplicationProxyName> is the name of the Search service application proxy.

    Note

    If you are backing up the farm for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup. To display the progress of the backup operation, use the Verbose parameter.

    Use the full path of the Search service application proxy.

For more information, see Backup-SPFarm.

Note

We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

You can use Central Administration to back up search. This procedure backs up all search components, the databases, the Search service configuration, and all index files.

To back up search by using Central Administration

  1. Verify that the user account that performs this procedure is a member of the Farm Administrators group.

  2. In Central Administration, on the home page, in the Backup and Restore section, click Perform a backup.

  3. On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, in the list of components, expand Shared Services and then expand Shared Services Applications to view the list of service applications in the farm. Select the check box for the Search service application from the list of components, and then click Next.

    Note

    The Search service application might consist of several components. You must select the check box for the top-level component. By default, the service application is named “Search Service Application”.

  4. On the Perform a Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select either Full or Differential.

    Note

    If you are backing up search for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup.

  5. In the Backup File Location section, in the Backup location box, type the path of the backup folder, and then click Start Backup.

    You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current backup job in the lower part of the page in the Backup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are timer service jobs. Therefore, it might take several seconds for the backup to start.

    If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 5.

  6. After the Service application backup has finished, you must also back up the service application proxy. To do this, in Central Administration, on the home page, in the Backup and Restore section, click Perform a backup.

  7. On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, in the list of components, expand Shared Services and then expand Shared Services Proxies to view the list of service application proxies in the farm. Select the check box for the Search Service Application proxy from the list of components, and then click Next.

  8. On the Perform a Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select either Full or Differential.

    Note

    If you are backing up search for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup.

  9. In the Backup File Location section, in the Backup location box, type the path of the backup folder, and then click Start Backup.

    You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current backup job in the lower part of the page in the Backup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are timer service jobs. Therefore, it might take several seconds for the backup to start.

    If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 9.

If you cannot use either the Windows PowerShell or Central Administration to back up the Search service application and associated data, you can manually back them up by using SQL Server tools. You must follow these steps:

  1. Pause the Search service application.

  2. Export the search topology XML file to another location, such as the backup location.

  3. Use SQL Server tools to back up all the databases associated with the Search service application.

  4. Copy all of the index files for all query components to the backup location.

  5. Resume the Search service application.

To pause the Search service application by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: See 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:

    $ssa = Get-SPEnterpriseSearchServiceApplication <SearchServiceApplicationName>
    $ssa.Pause()
    

    Where:

    • <SearchServiceApplicationName> is name of the Search service application.

To export the search topology XML file by using Windows PowerShell

  1. At the Windows PowerShell command prompt, type the following command:

    Export-SPEnterpriseSearchTopology -Filename <Path> -SearchApplication <GUID>
    

    Where:

    • <Path> is the full path of the location to which you are exporting the topology file. For example, E:\Backups\Search\SearchTopology.xml.

    • <GUID> is the identity of the Search service application.

To back up all the databases associated with Search service application by using SQL Server tools

  1. Verify that the user account that is performing this procedure is a member of the SQL Serverdb_backupoperator fixed database role on the database server where each database is stored.

  2. Start SQL Server Management Studio and connect to the database server.

  3. In Object Explorer, expand Databases.

  4. Right-click the database that you want to back up, point to Tasks, and then click Back Up.

  5. In the Back Up Database dialog box, in the Source area, select the kind of backup that you want to perform from the Backup type list. For more information about which backup type to use, see Overview of Recovery Models (https://go.microsoft.com/fwlink/p/?LinkId=114396) in SQL Server Books Online.

  6. In the Backup component area, click Database.

  7. Either use the default name or specify a name for the backup set in the Name text box.

  8. Specify the expiration date for the backup set. This date determines how long, or when, the backup set can be overwritten by any later backups that have the same name. By default, the backup set is set to never expire (0 days).

  9. In the Destination area, specify where you want to store the backup.

  10. Click OK to back up the database.

  11. Repeat steps 1-10 for the following databases:

    • Search service application Administration database

    • Crawl database

    • Property database

To copy all index files for all query components

  1. Verify that the user account that performs this procedure is a member of the Search Service Application Administrators group.

  2. In Central Administration, on the home page, in the Application Management section, click Manage service applications.

  3. On the Service Applications page, click the Search service application for which you want to view the location of the index files.

  4. On the Search Administration page, in the Search Application Topology section, click Modify.

  5. On the Manage Search Topology page, under Index Partition, point to the query component, click the arrow that appears, and then click Edit Properties.

  6. In the Edit Query Component dialog box, locate the path of the index, and then record it so that you can use it later to navigate to the index files.

  7. Click Cancel to exit the Edit Query Component dialog box.

  8. Repeat steps 4-7 for each query component.

  9. On the Manage Search Topology page, under Crawl, point to the crawl component that is associated with the query component, click the arrow that appears, and then click Edit Properties. Record the location of the crawl component.

  10. Click Cancel to exit the Edit Crawl Component dialog box.

  11. If you have more than one query component, perform the previous steps for each.

  12. Navigate to the index folder and copy the whole folder to your backup share.

  13. If you have more than one query component and / or index partition, follow these steps for each.

To resume the Search service application by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: See 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:

    $ssa = Get-SPEnterpriseSearchServiceApplication <SearchServiceApplicationName>
    $ssa.Resume()
    

    Where:

    • <SearchServiceApplicationName> is name of the Search service application.