Tuesday, February 2, 2016

Moving SharePoint 2013 Search to a different (or new) SharePoint Server



ABSTRACT

There are many times that a requirement to move Search and its components to a different server pops up.

Moving the Search topology in SharePoint 2013 can only be done using PowerShell. There is no built-in PowerShell command that will accomplish this so this document lists out the different steps that need to be done. An assumption is made that there is a working Search Service already existing.
I started my farm with one SharePoint server (AFSP2013WFE) that acted as the WFE and ran all services. Since this server is running out of resources, I need to move the Search Services off. I have created an additional SharePoint Server (AFSP2013APP) joined it to the farm and want to move the search services to this new server.

At the start of these operations, The Search Administration topology section looks like:


Step 1: CLONE THE EXISTING TOPOLOGY AND START THE SEARCH SERVICE ON THE NEW SERVER AFSP2013APP

The existing topology needs to be cloned in order to move all the search components, except for the Admin component which has to remain online to move all other components.(The Admin component will be moved at the end).

Note: Run PowerShell in Administrator mode and if you are using the regular PowerShell remember to add the SharePoint Snap in.

$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa –Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active

Step 2: START THE SEARCH SERVICE ON THE NEW SERVER AFSP2013APP

$AFSP2013APP = Get-SPEnterpriseSearchServiceInstance -Identity “AFSP2013APP“
Start-SPEnterpriseSearchServiceInstance -Identity $AFSP2013APP

Before proceeding ensure the new search service is online on the new server.

Use: Get-SPEnterpriseSearchServiceInstance -Identity $AFSP2013APP

You will see something similar to the following in the console. Look for the Status:

If the Status says anything other than online (like “provisioning”), wait a few minutes and retry the command. Repeat until you see that the Status is: Online.

Step 3: CREATE NEW SEARCH COMPONENTS ON THE NEW SEARCH SERVER
Create all Search components except for the admin component.
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $AFSP2013APP
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $clone -SearchServiceInstance $AFSP2013APP
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $clone -SearchServiceInstance $AFSP2013APP
New-SPEnterpriseSearchCrawlComponent -SearchTopology $clone -SearchServiceInstance $AFSP2013APP
New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -IndexPartition 0 -SearchServiceInstance $AFSP2013APP
Set-SPEnterpriseSearchTopology -Identity $clone

This process takes some time to complete. When complete, the Search Application Topology page will look like:




Note: The Admin component is running on the AFSP2013WFE only. All other components are running on both servers.

Step 4: REMOVE COMPONENTS FROM ORGINAL SEARCH SERVER

The identity of all the search components are required and can be obtained by the command:
Get-SPEnterpriseSearchComponent -SearchTopology $clone
Look through the output on the console as shown below to find the values applicable to the SharePoint farm. 

 
In this case, ContentProcessComponent1, QueryProcessComponent1, CrawlComponent0, IndexComponent1 and QueryProcessingComponent1, AnalyticsProcessingComponent1 are the names required.

Clone the topology and use Remove-SPEnterpriseSearchComponent for all components on the old server, except for the admin component. Note: the names are case sensitive!

$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa –Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Remove-SPEnterpriseSearchComponent -Identity ContentProcessingComponent1 -SearchTopology $clone -confirm:$false
Remove-SPEnterpriseSearchComponent -Identity QueryProcessingComponent1 -SearchTopology $clone -confirm:$false
Remove-SPEnterpriseSearchComponent -Identity CrawlComponent0 -SearchTopology $clone -confirm:$false
Remove-SPEnterpriseSearchComponent -Identity IndexComponent1 -SearchTopology $clone -confirm:$false
Remove-SPEnterpriseSearchComponent -Identity AnalyticsProcessingComponent1 -SearchTopology $clone -confirm:$false
Set-SPEnterpriseSearchTopology -Identity $clone

This process takes some time to complete. When complete, the Search Application Topology will look like:


Step 5: START AN ADMIN COMPONENT ON THE NEW SERVER
Clone the topology, identify the desitnation server and start a new admin component on the new server.

$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa –Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
$AFSP2013APP = Get-SPEnterpriseSearchServiceInstance -Identity “AFSP2013APP“
New-SPEnterpriseSearchAdminComponent -SearchTopology $clone -SearchServiceInstance $AFSP2013APP
Set-SPEnterpriseSearchTopology -Identity $clone

When complete, the Search Application Topology will look like:
 

Step 6: DELETE THE OLD ADMIN COMPONENT

Clone the topology and then delete the old admin component.
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa –Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Remove-SPEnterpriseSearchComponent -Identity AdminComponent1 -SearchTopology $clone -confirm:$false
Set-SPEnterpriseSearchTopology -Identity $clone

When this is done – takes a very long time, the Topology will look like:

All search components are now online on the new server.

Please comment on any items that do not work and also if you have a different/easier approach

No comments:

Post a Comment