SharePoint 2013 Moving the Search Query Component to a WFE

I’ve done this a number of times, and have used a variety of others (blog) posts to do this in the past, some of which have gone offline since I first started using them, as such, I wanted to keep track of how to do this for myself, so I’ve gone ahead and grabbed the PowerShell from the following blog post.

Many thanks to Steve Mann for this post, and I truly appreciate your efforts in figuring out the proper PowerShell to do this correctly.

http://stevemannspath.blogspot.ca/2013/03/sharepoint-2013-search-moving-query.html

Step #1 – Clone the Active Search Topology
# Clone the active search topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active

Step #2 – Add the New Search Component on the WFE
# Add New Search Component
$wfe = Get-SPEnterpriseSearchServiceInstance -Identity “[[web front end server name here]]”
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $wfe

Step #3 – Start the Search Instance on the WFE
# Start Instance On Different Server
Start-SPEnterpriseSearchServiceInstance -Identity $wfe

Step #4 – Activate the Cloned Search Topology
# Activate Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone

Step #5 – Clone the Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active

Step #6 – Get the ComponentID to Move
# Get the Search Component ID To Move
$queryComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity QueryProcessingComponent1).componentID

Step #7 – Remove the Search Component from the Original Server
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $queryComponentID.GUID -SearchTopology $clone -confirm:$false

Step #8 – Activate the Search Topology Again
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone

Again, all the credit to Steve Mann, much appreciated.