SharePoint 2013 - Move the Search Index Location

Sometimes you want to change the drive that the search index location is on because it fills up the drive fast. This is how you change the location via PowerShell


Source: https://sharepoint.stackexchange.com/questions/142486/how-do-i-move-the-search-indexlocation-sharepoint-2013



It is possible to change the search index location to a dedicated volume after the installation using PowerShell.
You can find a great artivle about it here, the following is an abstract from that post:
Managing the search topology in SharePoint 2013 can be done only via PowerShell.
Here is an article about the procedure:
Changing the search index location can be done by following the next steps:
  • Get the current search topology
  • Clone the current search topology
  • Modify the cloned Search topology(add a new index component with new search index location)
  • Activate the cloned search topology
  • Remove the old search topology
  • remove old index component(This means clone, modify, activate search topology and remove the old search topology)
Get the current Search topology
$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application" 
$instance=Get-SPEnterpriseSearchServiceInstance -Local
$current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa
Clone the current Search topology
$clone=New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current
Modify the cloned Search topology
This will add a second index component with a new index location.
New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -IndexPartition 0 -SearchServiceInstance $instance -RootDirectory "E:\NewIndexLocation"
Activate the cloned Search topology
Set-SPEnterpriseSearchTopology -Identity $clone
Remove the old Search topology
Remove-SPEnterpriseSearchTopology -Identity $current
The next step, remove the old index component, should be done when the new index component is ready. This can be checked from Central Admin on the Search Administration page, view the status of the search topology or use PowerShell Get-SPEnterpriseSearchStatus. The new index component must be Active.
Remove the old index component
This must be done by get, clone, modify, activate the new search topology and remove the old search topology.
$current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa
$clone=New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current
$comp=Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {$_.Name -eq "IndexComponent1"}
Remove-SPEnterpriseSearchComponent -Identity $comp -SearchTopology $clone
Set-SPEnterpriseSearchTopology -Identity $clone
Remove-SPEnterpriseSearchTopology -Identity $current
Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.