How to Restore Exchange Mailbox Database to a New Server

Written by

There could be many reasons why you need to restore a database. Let’s look at some common reasons.

  • The server has been re-installed, after failure.
  • The database gets corrupted or is not mounting.
  • You’re migrating to a new Exchange Server.
  • Your business has acquired another company and you need to merge the data.

In this article, we will be going through the ways to restore mailbox database to a new Exchange Server with no data loss and keeping the downtime to a minimum.

Ways to Restore Exchange Mailbox Database to a New Server

You can follow the below methods to restore Exchange mailbox database.

Note: Before you can start, it is important to take a backup of the failed Exchange server in case you need to revert or retrieve any files or information from the server. It is also important to check the previous backups. If the backups fail, then this could lead to major data loss.

Using Database Portability

Database Portability is a feature in Exchange Server (2007 till 2019) that allows to move, restore, or mount mailbox databases to a new Exchange Server and decrease the recovery time. However, there are some things to consider before proceeding.

  • You need the Organization Management and Recipient Management permissions to execute the operation.
  • You cannot move the mailbox database to a new Exchange Server in another organization as this method only allows to restore to the same Active Directory Forest.
  • The source and target databases must have the same database schema. This means that you cannot restore to a newer Exchange Server version or database schema.

Now, run the following ESEUTIL command to ensure that the database is in good health. You need to check the database state. It should be in Clean Shutdown state.

ESEUTIL /mh <edb database path>

This will confirm that the database is healthy and usable.

Next, you need to create the destination database using the following command.

New-MailboxDatabase -Name <DatabaseName> -Server <ServerName> -EdbFilePath <DatabaseFileNameandPath> -LogFolderPath <LogFilesPath>

After this, you need to restart the Exchange Information Store. Then, set the database to allow it to be overwritten.

Set-MailboxDatabase <Database Name> -AllowFileRestore $True

When this is done, copy the files restored from the previous server or restored files, including the Exchange Catalog, EDB files, and log files, to the specified folder in the creation command. After the move is complete, try to mount the database.

Mount-Database -Identity <database name>

After this process is complete, you need to run the following command to move the users from the old, copied database to the new one.

Get-Mailbox -Database <source database> |where {$_.ObjectClass -NotMatch '(SystemAttendantMailbox|ExOleDbSystemMailbox)'}| Move-Mailbox -ConfigurationOnly -TargetDatabase <target database>

Now, you need to trigger the delivery of any pending messages using the below command.

Get-Queue <Queue Name> | Retry-Queue -Resubmit $true

Using Windows Server Backup

You can restore the database from the last healthy backup. Here, we will be using Windows Server Backup as the backup software. Follow these steps to restore the database from backup:

  • Open Windows Server Backup and click on Recover.
  • Choose Another server and click Next.
  • Choose the location type and click Next to select the source of your backup location.
  • Select the backup you will be restoring from and then select Applications.
  • Select the Recover to another location and then select the location.
  • Choose which database to restore and click Next.

Note: The restored database will be in Dirty Shutdown state. To bring the database to clean shutdown state, you need to run the below ESEUTIL command.

ESEUTIL /r <log prefix> /l <folder path > /d <folder path for database>

After this, the database should be mounted.

Using Stellar Repair for Exchange

You can use a third-party Exchange recovery software, such as Stellar Repair for Exchange to restore database to a new server. With this software, you can easily open corrupt database, from any Exchange Server version, and with no size limit. The application scans the databases and then shows the entire structure of the databases. You can easily select the items to export recovered database directly to another Exchange Server database of any version (newer or older). With Stellar Repair for Exchange, you can also export recovered database directly to an Office 365 tenant and save to PST or other file formats.

Closing Thoughts

Above, we have discussed different methods to restore Exchange mailbox database to a new server. There are some limitations of using Database Portability method and Windows Server Backup. When restoring from the backup, you will lose data from the time backup was taken till the time when the server has failed. When using the portability method, the server must be online. Also, you can only restore to the same Exchange Server version and database schema. On the other hand, Stellar Repair for Exchange is an ideal tool and very simple to use. It features a lot of functions and helps restore database even from corrupted database of any Exchange Server version, without any restrictions or limitations.

Brought to you by

What’s hot on Infosecurity Magazine?