Removing the SharePoint 2010 Search Service can become quite a pain. Especially when the removal hasn’t work out the way it should have. So what do you do when the removal failed and your attempts to reinstall the search service are failing as well? I suffered from the same pains and therefor I’ll go thru the step I took to get my search service back online in this blog article.
The First thing to know is you do not simply remove the search service from a SharePoint Farm.
The second thing is how to clean up your mess....
The search service in SharePoint 2010 is, let’s say, different. It is integrated as a service application into SharePoint but the administration is done thru its own interface. For instance starting or stopping the service on a farm server cannot be managed thru the “Manage services on server” setting in the central administration. Instead you must change the topology of the search infrastructure. But you probably know this already.
So, in my case the customers search infrastructure was ‘a little bit messed up’. In fact it didn’t work at all and the attempts to recover search from the backup wasn’t helping either. Because the search index was very small and recreating the index wouldn’t take too long, the decision was made to recreate the search service.
Words of advice
You should be very confident in working with SharePoint. A good understanding and experience how to work with the Powershell and the Internet Information Server are necessary.
Removing the service application from the farm
- Removing thru the central administration
- By the Powershell
- With STSADM.EXE
Finding the ID for the service application
STSADM.EXE -o deleteconfigurationobject -id <GUID of the service>
Cleaning the proxy connections
Deleting an old proxy connection is pretty simple.
- Go to the Central Administration into the Application Management
- Choose Manage service applications
- Look for the old Search Service Application Proxy entry in the list and if it still exists, just delete it.
Make sure it is the one from the service application you deleted in advance.
Cleaning up the service pool
SharePoint Service Application Pool
Said so, we’ll take a look at the Service application pool next. Return to your Powershell and execute the following command:
Remove-SPServiceApplicationPool <Name of the application pool>
IIS Application Pool
To remove the application pool from the IIS we’ll open the Internet Information Services Manager in Windows and select the Application Pools in the navigation pane. Finding the right application pool can be a bit tricky because the Name is a Guid. There are a few hints e.g. if you used a dedicated account for the search service application pool or the low number of connected applications to that pool. To be sure right click on an application pool entry and select View Applications. Look at the Physical Path and see if its location is pointing to the search web service directory. If you found the right application pool you can delete it. But before doing so, we’ll remove the WCF endpoints first.
Deleting the WCF service endpoint
In the IIS Manager Navigation pane, open the SharePoint Web Services application and look for the Guid that is connected to application pool. Validate you have chosen the correct WCF endpoint by selecting the Basic Settings action in the Action pane. Look at the Physical Path and see if its location is pointing to the search web service directory. When you have the right WCF endpoint for the search service, delete it. After you have removed the search service WCF endpoint you can continue to remove the application pool as well.
Deleting the search index
The default location for the index files is C:\ProgramFiles\Microsoft Office Servers\14.0\Data. For you the location may have been relocated to an other destination.
Stoping the search service instances
Our final step is to make sure all search service instances are stopped in the farm. To find all instances return to the Powershell and use the following command:
Get-SPEnterpriseSearchServiceInstanceThis returns a list of all servers in your farm hosting the search service. For all entries in the list the Status should be Disabled instead of Online. If one or more of the instances are online we must shut them down. To do so we need the Id that can be seen in the list returned as well. Use the following command inside the Powershell:
Stop-SPEnterpriseSearchServiceInstance -Identity <Enterprise Search Service Instance ID>
Recreating the search service application
Well I hope this helped someone out there to get their search service running again. For me it sure did.