Move SharePoint 2013 Search Index Location

This script will move a SharePoint 2013 Search Index to a specific location

 
 
 
 
 
4.3 Star
(34)
6,622 times
Add to favorites
SharePoint
9/3/2013
E-mail Twitter del.icio.us Digg Facebook
  • The script will delete all the index partitions
    1 Posts | Last post October 09, 2017
    • I believe this script is going to delete all the index components, if someone has more than one index component and changes only the location of one of them, because you are deleting all the index partitions without specifying the index partition number! - The below should help in avoiding this!
      
      OLD
      =====
      Get-SPEnterpriseSearchComponent -SearchTopology $Clone | ? {($_.GetType().Name -eq "IndexComponent") -and ($_.ServerName -eq $($Instance.Server.Address)) -and ($_.RootDirectory -ne $IndexLocation)} | Remove-SPEnterpriseSearchComponent -SearchTopology $Clone -Confirm:$false; 
      
      
      New
      =====
      
      Get-SPEnterpriseSearchComponent -SearchTopology $Clone | ? {($_.GetType().Name -eq "IndexComponent") -and ($_.ServerName -eq $($Instance.Server.Address)) -and ($_.RootDirectory -ne $IndexLocation) -and ($_.IndexPartitionOrdinal -eq 0)} | Remove-SPEnterpriseSearchComponent -SearchTopology $Clone -Confirm:$false; 
  • Error when running the script
    4 Posts | Last post March 11, 2015
    • 
      
      Remove-SPEnterpriseSearchTopology : Cannot make changes to topology in : Active state
      At C:\Move-SPEnterpriseSearchIndex.ps1:27 char:5
      +     Remove-SPEnterpriseSearchTopology -Identity $Current -Confirm:$false;
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (Microsoft.Offic...eSearchTopology:RemoveSearchTopology) [Remove-SPEnterpriseSearchTopology], I
         nvalidTopologyException
          + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.RemoveSearchTopology
      
      Set-SPEnterpriseSearchTopology : Topology modification is not possible. SearchServiceApplication 'Search Service Application' is paused
      for with reason(s) other than Index Repartitioning.
      At C:\Move-SPEnterpriseSearchIndex.ps1:36 char:5
      +     Set-SPEnterpriseSearchTopology -Identity $Clone;
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (Microsoft.Offic...tSearchTopology:SetSearchTopology) [Set-SPEnterpriseSearchTopology], Invalid
         TopologyOperationException
          + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.SetSearchTopology
      
      Remove-SPEnterpriseSearchTopology : Cannot make changes to topology in : Active state
      At C:\Move-SPEnterpriseSearchIndex.ps1:38 char:5
      +     Remove-SPEnterpriseSearchTopology -Identity $Current -Confirm:$False;
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (Microsoft.Offic...eSearchTopology:RemoveSearchTopology) [Remove-SPEnterpriseSearchTopology], I
         nvalidTopologyException
          + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.RemoveSearchTopology
      
      The Index has been moved to E:\Index on AGA-DEN-SP01
      This will not remove the data from the old index location. You will have to do that manually :)
      PS C:\>
    • Hi Chris-
      
      You may have already solved this, but you probably have bad cache and/or need to reset your search index. Resetting the index is simple enough, and to clear the app cache look here:
      
      http://www.social-point.com/sharepoint-2010-event-id-6482-application-server-administration-job-failed-for-service-instance-microsoft-office-server-search-administration-searchserviceinstance
    • Check the article at http://technet.microsoft.com/en-us/library/dn745901(v=office.15).aspx. You probably have the Search Service application paused.
    • Is this script is going to help?
  • Showing error while moving
    1 Posts | Last post March 11, 2015
    • The UI is showing error while moving. 
  • Is this Work ing for you?
    1 Posts | Last post December 04, 2014
    • Hi i tried this. Some folders are created in new location. after changing this index i have uploaded 20 MB documents into SP site. after that i ran incremental crawl. again i checked the folder size unfortunately it is increased in C Drive only not in new Location. 
      
      Pl help me to resolve this issue.
  • How to run this Script
    1 Posts | Last post September 21, 2014
    • I am unable to run with SharePoint Powershell,Kindly suggest me how to run .ps1 file on powershell,I am getting error.
  • Unable to get script to run
    2 Posts | Last post September 05, 2014
    • When I try to run the script, I keep getting 
      
      PS> Get-SPServiceApplication "Search Service Application 1"
      Get-SPServiceApplication : Cannot bind parameter 'Identity'. Cannot convert value "Search Service Application 1" to type "Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind". Error:
      "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
      At line:1 char:26
      + Get-SPServiceApplication "Search Service Application 1"
      +                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-SPServiceApplication], ParameterBindingException
          + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePoint.PowerShell.SPCmdletGetServiceApplication
      
      But I see this:
      
      
      PS> Get-SPServiceApplication|fw
      
      
      SecurityTokenServiceApplication                   Topology
      WSS_UsageApplication                              595dda7e-4b06-4311-bfdb-41c660a86a46
      Search Service Application 1
      
      so I have the service name correct as far as I can tell.
      
      Looking at the script, it is just getting started - there isn't something else that might have gone wrong as far as I can tell.
      
      
    • Check the article at http://technet.microsoft.com/en-us/library/dn745901(v=office.15).aspx. You probably have the Search Service application paused.
  • Well, that made me feel really stupid...
    1 Posts | Last post September 02, 2014
    • After struggling all morning, I tried to create a test powershell script to see why the function seemed to be dropping the 1 at the end of my app name.
      I created my own function and tried to run it and didn't get any output.
      I scrolled to the bottom of your script to see if there was anything off the screen that I might be missing.
      That's when I see that the last line of the downloaded script invokes the function, with a set of example parameters.
      The script wasn't dropping part of my argument - it was ignoring all the command line arguments and using the invocation in the downloaded file.
      
      Embarrassing.
      
      Maybe my mistake will help someone else who is almost as clueless as I am.
      
      Thank you, and have a nice day.
  • Follow up info on my problem with the script.
    1 Posts | Last post September 02, 2014
    • I rebooted the server after some other weird behavior. Now the error I get is this.
      PS> .\Move-SPEnterpriseSearchIndex.ps1 -SearchServiceName "Search Service Application 1" -Server ntpssptmp01 -IndexLocation "D:\index"
      Service Name is:  . Search Service Application
      Get-SPServiceApplication : Object not found.
      At C:\users\sa_spinstallerdev\documents\WindowsPowerShell\Move-SPEnterpriseSearchIndex.ps1:12
      char:12
      +     $SSA = Get-SPServiceApplication -Name $SearchServiceName;
      +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Microsoft.Share...viceApplication:SPCmdletGetServic
         eApplication) [Get-SPServiceApplication], InvalidOperationException
          + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetServiceApplication
      
      Cant find a Search Service Application: "Search Service Application"
      At C:\users\sa_spinstallerdev\documents\WindowsPowerShell\Move-SPEnterpriseSearchIndex.ps1:13
      char:14
      +     if (!$?){throw "Cant find a Search Service Application: `"$SearchServiceName ...
      +              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : OperationStopped: (Cant find a Sea...ce Application":String) [], Run
         timeException
          + FullyQualifiedErrorId : Cant find a Search Service Application: "Search Service Application"
      
      
      I added a write-host to show what was coming in from the command line.
      The write host shows the value of the $SearchServiceName is missing the final " 1" that I typed on the command line. Without that, the error that I am seeing is correct.
      However, as you can see above, on my command line I have the " 1".
      Is there a maximum length of parameter for PowerShell?
  • Does not work on Foundation
    1 Posts | Last post July 03, 2014
    • Hey Ivan
      
      Thanks for the awesome script! It does not work on foundation though and fails with the following error:
      -------------
      New-SPEnterpriseSearchIndexComponent: Access to this functionality requires a SharePoint Server Client Access License.
      -------------
      New-SPEnterpriseSearchIndexComponent is not available on foundation. Any alternatives?
      
      
  • Wait loop ?
    1 Posts | Last post February 18, 2014
    • After setting the cloned topology to active it seems risky to immediately delete the old one as there could be a massive index mirroring taking place ?
1 - 10 of 11 Items