Following up on my last post “SharePoint 2013 Moving the Search Query Component to a WFE“, again, I’ve used a variety of others (blog) posts to do this in the past, some of which have gone offline and 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.
Once again, a great 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: Get the Search Service Instance and Start on the WFE
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity “[[WFE Server Name]]”
Start-SPEnterpriseSearchServiceInstance -Identity $ssi
Step #2: Wait for the Search Service to Come Online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi
Step #3: Clone the Active Search Topology
#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #4: Create the New Index Component on the WFE
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0
-RootDirectory “E:\SPIndex”
Ahead of time, a folder named SPIndex was created on the E: drive of the WFE. Modify this for your own location.
Step #5: Activate the Cloned Search Topology with the New Index Component
#Activate the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone
Step #6: Monitor the Distribution of the Index
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
Step #7: Clone the Active Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #8: Get the ID of the Index Component to Remove
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity IndexComponent3).componentID
**Note** in this instance, the component was IndexComponent3 – yours may be different.
Use Get-SPEnterpriseSearchStatus -SearchApplication $ssa to see which components you have.
Step #9: Remove the original Index Component
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false
In this case there was two components on two servers so steps #8 and #9 were repeated.
Step #10: Activate Search Topology Again
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone
Step #11: Monitor the Distribution of the Index (this time it should be instantaneous)
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
Once Again, all the credit to Steve Mann, much appreciated.