Restore search in SharePoint Server 2010

 

Applies to: SharePoint Server 2010

There are situations in which you might have to restore a Search service application instead of restoring the complete farm.

Important

You cannot back up from one version of Microsoft SharePoint Server and restore to another version of SharePoint Server.

Important

The procedures in this article restore the search components of Microsoft SharePoint Server 2010. If the topology includes Microsoft FAST Search Server 2010 for SharePoint, the procedures in this topic also restore the Content SSA and Query SSA (including the People Search index). However, in addition to performing the procedures in this article, you must restore the FAST Search Server 2010 for SharePoint farm. For more information, see Backup and restore (FAST Search Server 2010 for SharePoint).

In this article:

  • Use Windows PowerShell to restore a Search service application

  • Use Central Administration to restore a Search service application

  • Use SQL Server tools to restore search

Use Windows PowerShell to restore a Search service application

You can use Windows PowerShell to restore search. This procedure restores all of the search components, including the databases, the search service configuration, and all of the index files.

To restore a 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:

    Restore-SPFarm -Directory <BackupFolder> -Item <SearchServiceApplication> -RecoveryMethod Overwrite [-BackupId <GUID>] [-Verbose]
    

    Where:

    • <SearchServiceApplication> is the path and name of the Search service application in the following form: "Farm/Shared Services/Search Service Application01”.

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

    • <GUID> is the identifier of the backup file to use. To view the backups for the farm, type the following command: Get-SPBackupHistory -Directory <BackupFolder> -ShowBackup. If you do not use the BackupId parameter, the most recent backup will be used. You cannot restore search from a configuration-only backup.

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

    Restore-SPFarm -Directory <BackupFolder> -Item <SearchServiceApplicationProxyName> -RecoveryMethod Overwrite [-BackupId <GUID>] [-Verbose]
    

    Where:

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

    • <SearchServiceApplicationProxyName> is the path and name for the Search service application proxy in the following form: “Farm/Shared Services/Search Service Application01”.

    • <GUID> is the ID of the backup file to use.

    If you do not use the BackupId parameter, the most recent backup will be used. To view the backups for the farm, type the following command:

    Get-SPBackupHistory -Directory <BackupFolder> -ShowBackup
    

    Where:

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

    You cannot restore search from a configuration-only backup.

  7. If you re-encrypted the credentials for the default content access account and crawl rules before backing up the Search service application, you must decrypt them by using the To decrypt the credentials for the default content access accounts and crawl rules by using Windows PowerShell procedure later in this article.

  8. After the restore operation in finished, you must start the Search service application. To start the service application, type the following command:

    $ssa = Get-SPEnterpriseSearchServiceApplication <SearchServiceApplication>
    $ssaResume()
    

    Where:

    • <SearchServiceApplication> is the path and name of the Search service application in the following form: Farm\Shared Services Applications\<SearchServiceApplication>.

Use Central Administration to restore a Search service application

Use the following procedure to restore a Search service application by using the SharePoint Central Administration Web site. This procedure restores all of the search components including the databases, the search service configuration, and all of the index files.

To restore a Search service application by using Central Administration

  1. Verify that the user account performing 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 Restore from a backup.

  3. On the Restore from Backup — Step 1 of 3: Select Backup to Restore page, select the backup job that contains the search backup, or a farm-level backup, from the list of backups, and then click Next. You can view more details about each backup by clicking the (+) next to the backup.

    Note

    If the correct backup job does not appear, in the Backup Directory Location text box, type the Universal Naming Convention (UNC) path of the correct backup folder, and then click Refresh.
    You cannot use a configuration-only backup to restore search.

  4. On the Restore from Backup — Step 2 of 3: Select Component to Restore page, expand the Shared Services Applications node.

  5. Select the check box that is next to the Search service application that you want to restore, and then click Next.

  6. On the Restore from Backup — Step 3 of 3: Select Restore Options page, in the Restore Component section, make sure that Farm\Shared Services Applications\<SearchServiceApplication> appears in the Restore the following content list.

    In the Restore Options section, under Type of restore, select the Same configuration option. If you select this option, a dialog box appears that asks you to confirm the operation. Click OK.

  7. Click Start Restore.

    You can view the general status of all recovery jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current recovery job in the lower part of the page in the Restore 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 may take a several seconds for the recovery 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 Sprestore.log file at the UNC path that you specified in step 3.

  8. You must also restore the service application proxy. To do this, in Central Administration, on the Home page, in the Backup and Restore section, click Restore from a backup.

  9. On the Restore from Backup — Step 1 of 3: Select Backup to Restore page, select the backup job that contains the search backup, or a farm-level backup, from the list of backups, and then click Next. You can view more details about each backup by clicking the (+) next to the backup.

    Note

    If the correct backup job does not appear, in the Backup Directory Location text box, type the Universal Naming Convention (UNC) path of the correct backup folder, and then click Refresh.
    You cannot use a configuration-only backup to restore search.

  10. On the Restore from Backup — Step 2 of 3: Select Component to Restore page, expand the Shared Services Proxies node.

  11. Select the check box that is next to the Search service application proxy, and then click Next.

  12. On the Restore from Backup — Step 3 of 3: Select Restore Options page, in the Restore Component section, make sure that Farm\Shared Services\Shared Services Proxies\<Search service application proxy name> appears in the Restore the following content list.

    In the Restore Options section, under Type of restore, select the Same configuration option. If you select this option, a dialog box appears that asks you to confirm the operation. Click OK.

  13. Click Start Restore.

    You can view the general status of all recovery jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current recovery job in the lower part of the page in the Restore 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 may take a several seconds for the recovery 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 Sprestore.log file at the UNC path that you specified in step 3.

  14. If you re-encrypted the credentials for the default content access account and crawl rules before backing up the Search service application, you must decrypt them by using the To decrypt the credentials for the default content access accounts and crawl rules by using Windows PowerShell procedure later in this article

  15. After the restore operation in finished, the Search service application is paused. To start the service, do the following:

    1. In Central Administration, on the Home page, in the System Settings section, click Manage services on server.

    2. On the Services on Server page, in the SharePoint Server Search row, in the Action column, click Start.

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

  1. Create and configure the Search service application.

  2. Use SQL Server tools to restore all the databases associated with Search service application.

  3. Import all of the index files for all query components.

  4. Edit and restore the search topology XML file.

  5. Decrypt the credentials for the default content access account and crawl rules.

  6. Restart the Search service application.

To create and configure a new Search service application

  1. If the Search service application was deleted or became corrupted, you must create a new Search service application. For information about how to create a Search service application, see Create and configure a new Search service application (SharePoint Server 2010).

To restore all the databases associated with a Search service application by using SQL Server tools

  1. Verify that the user account performing this procedure is a member of the sysadmin fixed server role.

  2. If the SharePoint 2010 Timer service is running, stop the service and wait for several minutes for any currently running stored procedures to finish. Do not restart the service until after you restore the databases.

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

  4. In Object Explorer, expand Databases.

  5. Right-click the database that you want to restore, point to Tasks, point to Restore, and then click Database.

    The database is automatically taken offline during the recovery operation and cannot be accessed by other processes.

  6. In the Restore Database dialog box, specify the destination and the source, and then select the backup set or sets that you want to restore.

    The default values for destination and source are appropriate for most recovery scenarios.

  7. In the Select a page pane, click Options.

  8. In the Restore options section, select only Overwrite the existing database. Unless the environment or policies require otherwise, do not select the other options in this section.

  9. In the Recovery state section:

  10. Click OK to complete the recovery operation.

  11. Repeat steps 4 through 10 for each database that you are restoring.

  12. Start the SharePoint 2010 Timer service.

To copy all of the index files for all query components

  1. Verify that the user account that performs this procedure is an administrator of the Search service application.

  2. Navigate to the backup share where you backed up the index, and then copy the complete folder to the index location. You will type the path of this folder in these steps below.

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

  4. On the Service Applications page, click the Search service application for which you want to copy the index files.

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

  6. On the Mange Search Topology page, under Index Partition, select the query component, and then click Edit Properties.

  7. In the Edit Query Component dialog box, type the path of the index, and then click OK.

  8. On the Mange Search Topology page, under Crawl , select the crawl component, and then click Edit Properties.

  9. In the Edit Crawl Component dialog box, type the path of the crawl component and click OK.

  10. On the Manage Search Topology page, click OK.

  11. If you have more than one query component, follow these steps for each.

    Note

    The information in the index is only as recent as the time it was backed up. To have more recent information in the index, you must crawl content again.

  12. When you are finished, click OK on the Manage Search Topology page.

To edit and import the search topology XML file by using Windows PowerShell

  1. If the new search topology is not identical to the previous topology (that you backed up), you must edit the exported topology XML file to match the new topology.

  2. After editing the exported search topology XML file, you can import the file by using these steps:

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

    Restore-SPEnterpriseSearchServiceApplication -Name <SearchServiceApplicationName> -ApplicationPool <ApplicationPoolName>-TopologyFile <Path>
    

    Where:

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

    • <ApplicationPoolNname> is the name of the new application pool for the Search service application. This application pool cannot already exist.

    • <Path> is the full path and file name of the exported topology file. For example, E:\Backups\Search\SearchTopology.xml.

To decrypt the credentials for the default content access account and crawl rules by using Windows PowerShell

  1. If you re-encrypted the credentials for the default content access account and crawl rules before backing up the Search service application, you must decrypt them by typing the following command:

    $ssa = Get-SPenterpriseSearchServiceApplication <SearchServiceApplicationName>
    $ssa.ReEncryptExistingPasswords <Password>
    

    Where:

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

    • <Password> is a strong password that you used to re-encrypt the credentials for the default content access account and crawl rules before you backed up the Search service application.

To restart the Search service application by using Windows PowerShell

  1. 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.