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.
[accordion]
[tab title=”Contents of this article”]
[/tab]
[/accordion]
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).
- Run Windows Server Backup Management Console by performing wbadmin command.
- Select that you need to recover data from a backup stored on another location.
- Then assign that backup is stored in the Remote shared folder.
- Specify full UNC path with mailbox database backup (\\Bakup01\db\exchange2013 in our example)
- Then you should choose data and time of backup creation for its further recovery.
- Select that the following applications will be recovered (Applications item).
- Select Exchange item
- 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.
- 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:
1 | eseutil /mh c:\restore\3nd.edb | Select-String –Pattern “State:”,”Log Required:” |
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.
1 | eseutil /R E03 /L “C:\Restore” /D “C:\Restore” |
Check whether database is consistent and switched to the state Clean Shutdown.
Creation and Mounting of Recovery Database
After that you can create Recovery database and mount recovered from backup email database in it.
1 | New-MailboxDatabase –Recovery –Name RDB –Server Mail3 –EdbFilePath “C:\Restore\3nd.edb” -LogFolderPath “C:\Restore” |
Mount the database
1 | Mount-Database RDB |
Check whether the database is mounted successfully:
1 | Get-MailboxDatabase –Status RDB | fl Mounted |
In the next article of this run we will discuss the methods of getting mailboxes or separate emails from Exchange 2013 recovered database.
1 comment
Thanks for sharing the useful tips to recover Exchange 2013 databases through built-in command line tools. However, there are some situations (like severe corruption in databases) when these in built utilities do not work. In these cases, only a third party tool can be fruitful for you. Recently, we encountered severe corruption problem in Exchange 2013 server database due to hardware issue on server machine. After wasting many hours on web, we could not find a solution to resolve the problem and get back our inaccessible data. Then we selected this third party tool and successfully rebuilt severely damaged databases and directly mounted to production server: Exchange Server Recovery
We were happy to see all data in their original formats and now working fine.