I recently tested some restore operations on Exchange 2013. This is the step I did to do a “single mail” restore:
- Restore your backup mailbox database and logs to alternative location. (But do not change the filename on the DB, if you do this eseutil is not able to get this in clean shutdown state).
- Because this is is an restored database, the database most likely will in “dirty shutdown” status. Here is how I got it in “Clean Shutdown” with esutil
Verify that the restored database has status “dirty shutdown” with eseutil /mh E:testrestoreEX13.MDB02.edb
Also look at the Log required (4-4) and log committed (0-5). These log files are needed at a minimum to recover the database to a clean shutdown without data loss. In my case i have both this files
You can check the consistency of the needed logs by using the command eseutil /ml together with your log directory path and log prefix, in my example E02: eseutl /ml F:TestrestoreRDB1E02
When I did repair on the database I had huge problems with finding the correct eseutil command. But after I found this blogpost: http://blogs.technet.com/b/mspfe/archive/2012/09/06/why-exchange-databases-might-remain-dirty-after-eseutil-r-recovery.aspx I found out that I could use the command eseutil /R E02 /l “F:TestrestoreRDB1" /s "F:TestrestoreRDB1" /d "E:Testrestore"
Running this modified command, everything worked and the database ended up in a “clean shutdown”
It’s time to create a recovery database. Use the shell to create a recovery database and point it to the database we want to recover data from. In my example this is
New-MailboxDatabase -Recovery -Name TestRestore -Server Servername -EdbFilePath "E:TestrestoreEX13.MDB02.EDB" –LogFolderPath "F:TestrestoreRDB1"
Mount the database: Mount-Database testrestore.
Now it is time to do the fun work. Lets do some restore.
I will in this example restore the whole mailbox to a subfolder named Restore. To create a restore request, you must provide the DisplayName, LegacyDN, or MailboxGUID for the soft-deleted or disabled mailbox. To get a list of mailboxes you can restore run Get-mailboxStatistics –Database Testrestore
When I run the command documented on TechNet I got a strange error: Error detail: must be logging in with GUIDs. not legDN. I tried with the DisplayName, LegacyDN and MailboxGUID without success.
New-MaiboxRestoreRequest -SourceDatabase Testrestore-SourceStoreMailbox "EX2013" -TargetMailbox UPN –Targetfolder Restore
But I found another parameter I could use: -SkipMerging StorageProviderForSource. And guess what….