Posted on April 19, 2014 · Posted in Exchange

Exchange 2013 Database Recovery

Formerly, we discussed Exchange 2013 mailbox backup with a help of standard Windows Server Backup functionality and now let’s seehow to recover Exchange mailbox database from  backup which we got before.

A plan of mailbox database recovery provides two variants:

  • Database recovery with current database replacement – is used in case of database loss or fatal failures with active database.
  • Mailbox database recovery in separate Recovery database – is used for recovery of individual mailboxes or specific users` letters from backup. It doesn’t affect users` mailboxes in active database during recovery from backup.

Note. Recovery database (RDB) – special type of Exchange mailbox database which allows to connect (mount) any Exchange database recovered from backup. Thereafter, any mailbox, folder or even separate letter can be recovered from this Recovery Database.

Exchange Email Database Recovery from WSB Backup

In the previous article we used Powershell to backup Exchange database (it’s more convenient from backup process automation point of view). However, it’s more convenient to recover data from WSB graphic interface (it is rather difficult to imagine a plan with a fully automated mail recovery scenario).

  1. Run Windows Server Backup Management Console by performing wbadmin command.
  2. Select that you need to recover data from a backup stored on another location. recover exchange db from another location
  3. Then assign that backup is stored in the Remote shared folder.
  4. Specify full UNC path with mailbox database backup (\\Bakup01\db\exchange2013  in our example)
  5. Then you should choose data and time of backup creation for its further from available exchange 2013 backups
  6. Select that the following applications will be recovered (Applications item). Windows Server Backup: Applications recovery
  7. Select Exchange itemExchange 2013 recovery wizard
  8. Mailbox database can be recovered to original folder (Recover to original location) — in this case the current mail database can be recovered either to original folder (in this case the current database will be rewritten) or in any other folder. We will use the second option.recover exchange 2013 to another folder
  9. All you have to do is to wait for mail database recovery completion. After the process completion the files of recovered database will appear in C:\Recovery folder.

Check and restore the integrity of Exchange 2013 database

So we recovered Exchange 2013 database and transaction files from backup. But before starting Recovery Database creation and its mounting you need to transfer recovered database to a Clean Shutdown state, or it will be impossible to mount it. That is because immediately after recovery, Exchange database goes to non-consistent (Dirty shutdown) state because database was shutdown incorrectly and a part of transaction from log files were not replayed on database.

Use eseutil.exe utility for Exchange 2013 database state check and its integrity recovery. In our example the file with a base is called 3nd.edb and transaction logs have prefix E03.

Check the database state by performing the following command:

eseutil /mh c:\restore\3nd.edb | Select-String –Pattern “State:”,”Log Required:”

eseutil:check exchange db state - dirty-shutdown

The database is in “Dirty Shutdown” state. We need to transfer the database in “Clean Shutdown” state by recording required transaction log files in mailbox database. This operation is called database Soft Recovery.

eseutil /R E03 /L “С:\Restore” /D “C:\Restore”

eseutil: reply transaction log files on exchange db

Check whether database is consistent and switched to the state Clean Shutdown.

eseutil: clean shutdown

Creation and Mounting of Recovery Database

After that you can create Recovery database and mount recovered from backup email database in it.

Tip. You can create Recovery Database only from Exchange Management Shell.

New-MailboxDatabase –Recovery –Name RDB –Server Mail3 –EdbFilePath “C:\Restore\3nd.edb”  -LogFolderPath “C:\Restore”

New-MailboxDatabase create recovery db

Mount the database

Mount-Database RDB

mount recovery database in exchange 2013

Check whether the database is mounted successfully:

Get-MailboxDatabase –Status RDB | fl Mounted

Get MailboxDatabase Mount Status

In the next article of this run we will discuss the methods of getting mailboxes or separate emails from Exchange 2013 recovered database.

Related Articles