In Exchange 2010 there was a PowerShell script for rebuilding the search catalog. This is depreciated in Exchange 2013. TechNet contains instructions on copying the catalog from a working server in the DAG – but what about if the database is not a member of a DAG or all the catalog’s in the DAG are broken?
This blog post will attempt to answer this:
Ensure all Search Services are Running
If you cannot complete a search in OWA or you are using Outlook in Online mode (or searching in Outlook 2013 beyond the default one year of cached content) then you return to the server for the search to take place. Therefore on the server that is active for your mailbox database the following services need to be running:
- RTM: Microsoft Exchange Search Service
- CU1 and later: Microsoft Exchange Search Service and Microsoft Exchange Search Host Controller
Ensure that these services are running before attempting to complete a search.
Once they are running, check the health of the search catalog with the following cmdlet in Exchange Management Shell: Get-MailboxDatabaseCopyStatus
The last column will display the state of the index. Anything other than Healthy needs to be checked. Crawling as a response means the index is currently being created and updated.
Checking for Corrupt Search Catalogs
Run the Test-ExchangeSearch cmdlet to get back a set of results on the health of your search catalog. This will take a short while, as Exchange will write known content into the Health Mailboxes on each database and then query search for the words that it expects to find. Errors here such as Time out for test thread and Catalog State: FailedAndSuspended should be fixed.
If the mailbox database is part of a DAG and other working copies exist then you can reseed the catalog using Update-MailboxDatabaseCopy faileddb/server –CatalogOnly
If all the copies are failed then stop the services listed in the previous section and delete or rename the catalog folder and restart the services listed above. The search catalog will be rebuilt and will take some time.
The location of the search catalog is always a subfolder of the mailbox database file, and this folder can be found by running: Get-MailboxDatabase -Server servername | fl name,edbfilepath,guid
This will return the name, the path to the mailbox database and the database guid, and then all you need to do is navigate to the folder that contains the database and rename the folder with the GUID as the folder name. Any new name will do. If a folder does not exist of the GUID of the mailbox database then a new one will be created.
Start the services that you stopped above and shortly a new catalog folder will be created. Depending upon the size of the database, rebuilding the catalog could take some time. Run Get-MailboxDatabaseCopyStatus to see when the catalog has finished crawling. Crawling will take additional IO from your disks, and so it is recommended not to run these steps during the day when IO is required, unless fixing your search index is more important!
2 responses to “Rebuilding Search Catalogs on Exchange Server 2013”
Just in case Dag having 1 db with additional copy and both the catalog having issues rebuilding.
As mentioned above since they replicate with in the db sub folder and share the same catalog.
If both are failing to rebuild and we stopped the search service, what is the best practice to start with re-building, whether to rebuild starting with active node and starting then the passive node search service and initiate catalog seeding or at the same(parallel) time start the service on both node after deleting or renaming the catalog data folder?
You would remove the catalog from the active node and restart the service. This will begin to rebuild it. The passive node(s) will then pull the changes from the active. Therefore at the time of restarting the service on the active I would remove the passive catalog as well – which means a service restart on those too – though I have not seen this particular series of events and so have not actually tested these steps described in this reply.