SharePoint Search Runbook - Move Admin Components
This post may be used as a reference to help create or update a SharePoint search runbook.
Move Admin Components
In some environments it is necessary to separate admin components and crawl components. The PowerShell commands below may be used to move the admin components to a new server. This process assumes that search components are already running on the new admin servers and also assumes some search components will remain on the old admin servers. These steps describe the general process:
- Verify all search components are healthy
- Add new admin components
- Verify all search components are running
- Remove old admin components (NOTE: Search will be offline for a period of time during this step)
Use the following PowerShell to add the new admin components. Make sure you edit the server names.
# Add new admin components
$AddAdminServer1 = "Server2"
$AddAdminServer2 = "Server1"
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
$NewAdminServer1 = Get-SPEnterpriseSearchServiceInstance -Identity $AddAdminServer1
$NewAdminServer2 = Get-SPEnterpriseSearchServiceInstance -Identity $AddAdminServer2
# start a new admin component on the new server
New-SPEnterpriseSearchAdminComponent -SearchTopology $clone -SearchServiceInstance $NewAdminServer1
New-SPEnterpriseSearchAdminComponent -SearchTopology $clone -SearchServiceInstance $NewAdminServer2
Set-SPEnterpriseSearchTopology -Identity $clone
It will take approximately 10 minutes for the add command to complete. Once it has finished, refresh the Central Admin Search Application Topology and verify that all components are running.
Use the following PowerShell to remove the original admin components. Make sure you edit the server names. (NOTE: Search will be offline for a period of time during this process)
# Delete old admin components
$RemoveAdminServer1 = "OldAdminServer1"
$RemoveAdminServer2 = "OldAdminServer2"
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
$adminIdentiy1 = (Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {($_.ServerName -eq $RemoveAdminServer1) -and ($_.Name -Like "Admin*")}).ComponentId.GUID
$adminIdentiy2 = (Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {($_.ServerName -eq $RemoveAdminServer2) -and ($_.Name -Like "Admin*")}).ComponentId.GUID
Remove-SPEnterpriseSearchComponent -Identity $adminIdentiy1 -SearchTopology $clone -Confirm:$False
Remove-SPEnterpriseSearchComponent -Identity $adminIdentiy2 -SearchTopology $clone -Confirm:$False
Set-SPEnterpriseSearchTopology -Identity $clone
It will take between 15-30 minutes for the remove command to complete. Once it has finished, refresh the Central Admin Search Application Topology and verify that all components are running.
Please leave comments and share your experience. How long did the commands take to finish? How long was the search query experience offline?