Site icon Franky's Web

Exchange 2016: Restoring a database on another server

Exchange 2016 databases can also be restored from a backup to other Exchange 2016 servers. The database therefore does not necessarily have to be restored to the server on which it was backed up or was active. It does not matter whether the server was a member of a DAG. However, it is important that both Exchange servers use the same version of the operating system and the Exchange server.

In this small example, there are two Exchange 2016 servers, both Exchange servers run on Windows Server 2016. The two Exchange servers are not members of a DAG (Database Availability Group) Exchange and Windows are also at the current patch level.

Each Exchange server has a mailbox database (MDB1 and MDB2). In the MDB2 database there are two user mailboxes (User1 and User2). The environment therefore looks as follows:

To simulate an error, the Exchange Server TEX2 is switched off. The MDB2 database is therefore offline and the mailboxes of both users are offline.

To ensure that the MDB2 database is now available again as quickly as possible, it can be restored to TEX1. This saves time until the Exchange Server TEX2 is up and running again.

Restoring the database

In order to activate the database from the backup on TEX1, a new empty database must first be created on TEX1. The following command creates the MDB2-Restore database on the TEX1 server:

New-MailboxDatabase -Name "MDB-Restore" -Server TEX1 -EdbFilePath "D:\MDB2-Restore\MDB2-Restore.edb" -LogFolderPath "D:\MDB2-Restore"

The specified database folder does not yet contain a database file (.EDB).

The backup of the database is now restored to this folder and renamed to the specified name (-EdbFilePath):

In order for the restored database to be integrated, the database must be in the clean shutdown state. This can be checked with the following command:

eseutil /mh .\MDB2-Restore.edb

If the database from the backup does not yet have the Clean Shutdown State, is described here how the clean shutdown state can be restored.

Before the database can now be mounted, the restore from the backup must be permitted. This is done with the following command:

Set-MailboxDatabase "MDB-Restore" -AllowFileRestore:$true

The restored database can now be integrated and the status checked:

Mount-Database "MDB-Restore"
Get-MailboxDatabaseCopyStatus

Although the database with the mailboxes has now been restored, the user accounts of the two test users still refer to the "old defective" database MDB2. The following screenshot shows the user account of "User1", which still refers to the wrong database:

So that the accounts now point to the new restored database, all mailboxes from MDB2 must now be referred to the MDB2-Restore database (rehoming). The following command can be used for this:

Get-Mailbox -Database "MDB2" –resultsize unlimited | Set-Mailbox -Database "MDB-Restore"

After execution, the corresponding mailboxes now refer to the restored database and the users can reconnect:

There are other ways to restore databases. More methods will follow in the next articles. It can't hurt to know the options...

Exit mobile version