SharePoint 2013 – Restore Search Service Application on different Server or Farm
SharePoint 2013 – Restore Search Service Application on different Server or Farm
With the following steps you can restore an existing Search Service Application on a different Server or Farm.
For example if like to restore your Search Service Application from your Producion environment (PRD) farm to a development (DEV) farm.
Overview:
- Restore the Search Service Application databases from your source SQL server (e.g. Production) to the target SQL server. (e.g. Development)
Required Databases: AdminDb, AnalyticsReortingStore, CrawlStore, LinkStore (or only AdminDb depending on your needs)
- There are two ways to restore an Search Service Application.
– Method1: Restore Search Service Application with a new default topology
– Method2: Restore Search Service Application with a given predefined topology (e.g. exported from your Production farm and modified for your requirements in your DEV farm)
My suggestion is using Method2 in Step2. Because then you can define the path for your Search Service Index Location etc…
See the example from an topology.xml at the bottom of this blog post.
Step1:
Use your SQL Management Studio or an script to complete that task.
Step2-Method1: (New default Search Topology)
# Get the local Search Service Instance $searchInstance = Get-SPEnterpriseSearchServiceInstance -local # Create a new application pool for your restored Search Service Application $applicationPool = New-SPServiceApplicationPool -Name "SearchServiceApplicationPool" -Account "domain\username" # or get an already existing application pool that you like to use: # $applicationPool = Get-SPServiceApplicationPool -Identity <ApplicationPoolName> # Restore the Search Service Application Restore-SPEnterpriseSearchServiceApplication -Name <SearchServiceApplicationName> ` -ApplicationPool $applicationPool ` -AdminSearchServiceInstance $searchInstance ` -DatabaseName <SearchServiceApplicationAdminDbName> ` -DatabaseServer <DatabaseServer> `
Step2-Method2: (Given predefined Search Topology)
# E.g. Export the current Search Topology from your Production farm as xml file $ssa = Get-SPEnterpriseSearchServiceApplication Export-SPEnterpriseSearchTopology -SearchApplication $ssa -Filename <FilePath\searchtopology.xml>
Attention: Change the server names and SQL server name in the exported search topology to the names in your DEV environment
# Create a new application pool for your restored Search Service Application $applicationPool = New-SPServiceApplicationPool -Name "SearchServiceApplicationPool" -Account "domain\username" # or get an already existing application pool that you like to use: # $applicationPool = Get-SPServiceApplicationPool -Identity <ApplicationPoolName> # Restore the Search Service Application Restore-SPEnterpriseSearchServiceApplication -Name <SearchServiceApplicationName> ` -ApplicationPool $applicationPool ` -TopologyFile <FilePath\searchtopology.xml>
Last but not least check and modify the Search Content Sources in your restored Search Service Application –> Search Administration to the URLs from your DEV environment.
Tip: If continuous crawling was enabled then you first need to disable continuous crawling to be able to change the URLs.
TechNet Source: Link
Example: topology.xml for an Search Service Application with 2 Search / Application Servers
<?xml version="1.0" encoding="utf-8"?> <Topology xmlns="http://schemas.microsoft.com/office/2012/search/topology"> <SearchServiceApplicationId><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></SearchServiceApplicationId> <SearchServiceApplicationObjectId><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></SearchServiceApplicationObjectId> <CreationDate><!-- 2017-01-20T10:00:00.000Z --></CreationDate> <Components> <Component> <Type>IndexComponent</Type> <Name>IndexComponent2</Name> <Server><!-- SearchServer2 --></Server> <Property> <Key>IndexPartitionOrdinal</Key> <Value>0</Value> </Property> <Property> <Key>RootDirectory</Key> <Value>D:\SPSearchIndex</Value> </Property> </Component> <Component> <Type>CrawlComponent</Type> <Name>CrawlComponent1</Name> <Server><!-- SearchServer1 --></Server> </Component> <Component> <Type>AnalyticsProcessingComponent</Type> <Name>AnalyticsProcessingComponent2</Name> <Server><!-- SearchServer2 --></Server> </Component> <Component> <Type>ContentProcessingComponent</Type> <Name>ContentProcessingComponent2</Name> <Server><!-- SearchServer2 --></Server> </Component> <Component> <Type>QueryProcessingComponent</Type> <Name>QueryProcessingComponent2</Name> <Server><!-- SearchServer2 --></Server> </Component> <Component> <Type>CrawlComponent</Type> <Name>CrawlComponent0</Name> <Server><!-- SearchServer2 --></Server> </Component> <Component> <Type>AnalyticsProcessingComponent</Type> <Name>AnalyticsProcessingComponent1</Name> <Server><!-- SearchServer1 --></Server> </Component> <Component> <Type>ContentProcessingComponent</Type> <Name>ContentProcessingComponent1</Name> <Server><!-- SearchServer1 --></Server> </Component> <Component> <Type>AdminComponent</Type> <Name>AdminComponent1</Name> <Server><!-- SearchServer1 --></Server> </Component> <Component> <Type>QueryProcessingComponent</Type> <Name>QueryProcessingComponent1</Name> <Server><!-- SearchServer1 --></Server> </Component> <Component> <Type>IndexComponent</Type> <Name>IndexComponent1</Name> <Server><!-- SearchServer1 --></Server> <Property> <Key>IndexPartitionOrdinal</Key> <Value>0</Value> </Property> <Property> <Key>RootDirectory</Key> <Value>D:\SPSearchIndex</Value> </Property> </Component> <Component> <Type>AdminComponent</Type> <Name>AdminComponent2</Name> <Server><!-- SearchServer2 --></Server> </Component> </Components> <Stores> <Databases> <Database> <Type>Admin</Type> <Name>SharePoint_SearchServiceDB</Name> <Server><!-- SQLServer --></Server> <Id><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></Id> </Database> <Database> <Type>AnalyticsReporting</Type> <Name>SharePoint_SearchServiceDB_AnalyticsReportingStore</Name> <Server><!-- SQLServer --></Server> <Id><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></Id> </Database> <Database> <Type>Crawl</Type> <Name>SharePoint_SearchServiceDB_CrawlStore</Name> <Server><!-- SQLServer --></Server> <Id><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></Id> </Database> <Database> <Type>Link</Type> <Name>SharePoint_SearchServiceDB_LinksStore</Name> <Server><!-- SQLServer --></Server> <Id><!-- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --></Id> </Database> </Databases> </Stores> </Topology>