We moved our search index from C:\ to E:\ drive by create new search topology from below script to avoid C:\ drive ran out of disk space:
Set Index/Replicas directories location, maker sure you do this for both Index server
$IndexLocation = "E:\SPIndex"
Create Index/Replicas directories maker sure you do this for both Index server
Remove-Item -Recurse -Force -LiteralPath $IndexLocation -ErrorAction SilentlyContinue
mkdir -Path $IndexLocation -Force
Create new search topology
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity 'Search Service Application'
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "SPApp1"
$hostB = Get-SPEnterpriseSearchServiceInstance -Identity "SPApp2"
Below commands will start the search service instance on all 2 servers.
Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Start-SPEnterpriseSearchServiceInstance -Identity $hostB
Below commands will show the status of search service instance on all the servers. Wait untill all the services have been succesfully started.
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostB
Create search component A
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
Create search component B
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
Create search component A
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
Create search component B
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
Create index partition and replicas A
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTopology -SearchServiceInstance $hostA -RootDirectory $IndexLocation -IndexPartition 0
Create index partition and replicas B
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTopology -SearchServiceInstance $hostB -RootDirectory $IndexLocation -IndexPartition 0
Create search query processing componenthost A
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
Create search query processing componenthost B
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
Active new topology - Before activate, make sure to reset content index - When powershell command below completed (return to prompt), wait for few minutes for the script completed the processing
Set-SPEnterpriseSearchTopology -Identity $newTopology
Last step is cleanup old topology
Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$.State -eq "Inactive"} |% { Remove-SPEnterpriseSearchTopology -Identity $ -Confirm:$false};
Confirm if old topology had been deleted
Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq "Inactive"}
However, when we run full crawl with new topology above, C:\ drive still running out of space, so I ran the below 2 commands to check Index location
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$ssa.AdminComponent.IndexLocation
PS C:\Windows\system32> $ssa.AdminComponent.IndexLocation
C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications
It pointed C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications and this caused C:\ drive ran out of diskspace.
How can I change all the index related components/location point to D:\ drive instead of C:\ without reinstall SharePoint?
I found dozens of articles recommended to change from window registry to clone new topology and none of them is working. After I try and run $ssa.AdminComponent.IndexLocation, it still point to C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications.
Please help.
Thanks
Tee
