Home » Exchange Server » Rebuilding Content Indexes for Exchange Databases

Rebuilding Content Indexes for Exchange Databases

In the comments of my blog post about repairing failed content indexes, Tipza asks

How do you monitor the status of this rebuild?

To answer the question, here’s an excerpt from the Exchange Server Troubleshooting Companion.

When the content index for a database has become corrupt, it will need to be rebuilt, or reseeded from another database copy in the DAG. For now, let’s look at the process for a non-DAG Mailbox server, and demonstrate the different procedure for DAGs later in this chapter.

This process involves removing the existing content index files, which will trigger Exchange Search to re-index that database. The re-indexing process can cause a high load on the Exchange server, which may impact performance for the server. So you should carefully consider the timing of any content index rebuilds, and how it might impact your end users. The content index files are located in the same path as the database EDB file, in a sub-folder named with a GUID.

5-content-index-01

Before the corrupt index files can be removed, the Exchange Search services must be stopped. While these services are stopped, searches in OWA will not be able to be performed by end users, and all of the database content indexes on the server will be reported as “Failed” by Get-MailboxDatabaseCopyStatus.

Next, delete the GUID-named folder that contains the content index files. If the folder will not delete due to files in use, then it’s likely that either:

  • You haven’t stopped the correct search services
  • Another process, such as file-level anti-virus software, has a lock on the folder (and may be the cause of the index corrupting to begin with)

After deleting the files, start the search services again.

After a delay while Exchange Search evaluates the situation, the database will be re-indexed. The content index will have a state of “Crawling” while this is occurring.

You can monitor the progress of the database crawl by watching the MSExchange Search IndexesCrawler: Mailboxes Remaining counter in Performance Monitor for that database instance.

5-content-index-02

Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server

2 comments

  1. Andreas Dieckmann says:

    Once I had to run this rebuilding process for some bigger databases in a customers Exchange environment. The rebuilding took about 1-1.5 days per database.
    If you don’t need to fully rebuild the index, you can update it from a non-corrupted database copy by:
    Update-MailboxDatabaseCopy -Identity DATABASE-NAMEDATABASE-NAME -CatalogOnly
    That’s way faster. Sadly I could use that command only for a few databases, because in most of the cases all database copies had damaged search indexes.

    I also wonder why Microsoft removed the “ResetSearchIndex.ps1” which still existed in Exchange 2010.

  2. Mikel Farley says:

    I migrated my Database and Log folder to an external drive because of my C: is too small, and now my index is failed. I’ve done the steps above twice and it failed both times. Everything is working as far as I know except we can’t search for anything (which is kind of a big deal apparently). Am I missing something?

Leave a Reply

Your email address will not be published. Required fields are marked *