How to Restore Database from Backup if MCDB is Enabled in Exchange Server 2019?
Summary: When restoring database from backup on Exchange Server 2019 with MetaCache Database (MCDB) enabled, you may encounter a situation where the database doesn’t mount even if it is in Clean Shutdown state. In this post, we will be discussing this issue in detail and the solutions to resolve it. We will also be mentioning a reliable Exchange repair software that can help in restoring the database if it is corrupted or in Dirty Shutdown state.
The MetaCacheDatabase (MCDB) is a feature introduced in Exchange Server 2019 that allows the mailbox database in a Database Availability Group (DAG) to be accelerated, beefing up the performance when using Solid State Drives (SSDs) for storing the databases. MCDB is a cache between the database and the user, used to accelerate the access to and from the database.
Now, you cannot have the actual Exchange Server databases on the SSDs as they would be more expensive. So, let’s assume that the databases are stored on a SAS or Near Line SAS drives or RAID volumes, with SSD drives to be used for the MetaCache database. The SSDs you would use should be of “mixed use” and support one drive write per day (DWPD) or greater, in terms of write endurance.
When setting up a drive to store the MetaCache database, you need to consider the actual mailbox database and storage needs to be provisioned correctly for the setup. So, it’s important to take into account all the considerations when enabling the MetaCache database for your Exchange Server, when it comes to storage and resources.
Troubleshooting Common Issues while Restoring the Database
Let’s say, you have a Database Availability Group (DAG) with the MetaCache Database (MCDB) feature enabled. You are restoring a mailbox database in a recovery storage group. The restore operation is successful but unfortunately, the database is not mounting.
In such a scenario, the first thing to do is check if the restored database is corrupted. For this, you need to use the EseUtil /MH parameter to check the shutdown state of the database.
EseUtil /MH <path of the edb file>
As you can see (in above image), the database state is shown as Clean Shutdown. Despite this, the database is not mounting. It means the recovery database is intact. Otherwise, the state would be Dirty Shutdown.
This may happen due to the following factors:
- An issue with the backup software or media during the restoration of the files.
- Issues with the configuration of Exchange Server and MCDB.
- Backup software is not compatible with the version of Exchange Server installed and is not application aware.
Possible Solutions to Restore Database when MCDB is Enabled
Here are some possible solutions you can try to resolve the issue.
1. Reset the Links between the Database and the MCDB
MetaCache Database (MCDB) gets linked to the primary database when backing up the database. These links expire when the database is restored. So, you need to reset and break the links between the database in question and the MetaCache Database. To do this, you need to use the EseUtil with the /r parameter.
Eseutil /r E01 /d "<database folder>" /i
This will initiate a soft recovery of the database. Since, you have recovered the database, the folder must point to the recovery database you restored from the backup. After this is complete, the database should be able to mount.
2. Create a Recovery Database
To restore data from a database which has MCDB feature enabled, you need to first restore the database, along with the transaction logs to a temporary location. Once this is done, you need to create a recovery database with the restored files.
New-MailboxDatabase -Recovery -Name <RDBName> -Server <ServerName> -EdbFilePath <RDBPathandFileName> -LogFolderPath <LogFilePath>
Now, before mounting the database, run the EseUtil /mh command to check the state of the database.
Eseutil /mh <edb file path>
After this is complete and the database state is in Healthy Shutdown state, run the following command.
Eseutil /r E01 /d "<database folder>" /i
Now, the database should mount.
What if the above fails?
If still you’re not able to mount the database, then there might be underlying issues or configuration issues on the Exchange Server, hindering the mounting of the database. In such cases, where you have exhausted the native tools and other options, you need to consider an external application to do the job. Stellar Repair for Exchange is one such reliable Exchange Database Recovery software, recommended by most MVPs that can come in handy in such situations. You can restore or move the EDB file with the issue separately on another server and create a new mailbox database on the server. Then, use the Stellar Repair for Exchange to open the file, even if it is corrupted or in Dirty Shutdown state, and export its data directly to the live Exchange Server database.