Navigation-Menus (Do Not Edit Here!)

Monday, May 28, 2012

Recover Exchange Mail store Using Database portability feature in Exchange 2010

"Mail server crashed" worst nightmare for a System admin. Followed by tight Dead lines, incident reports, load of complains you have to listen to, Its a full fledged disaster.
In this scenario its a medium size business with with just one single Server running AD and Exchange 2010(not ideal i know) which was upgraded from SBS 2003

AD and DNS failed after de-commissioning the old SBS server.

Recovering from full server backup was not an option and we had the Databases on a separate drive.

Important things to keep in mind when recovering DB's on a different AD domain

  • Organization name and the Exchange Administrative Group should be the same in order for the Portability feature to work
  • Database must be in a clean shutdown state
  • After mounting the old DB's always move the mail boxes to new database's
  • Exchange 2010 Slandered only supports up to 5 Databases.

there are few method's to recover DB's on exchange 2010, This is the method we used.

Check List before proceeding further

Once you have
  • Restored the Old Databases from backup to a different location on the server
  • installed the AD (with the same domain name) and the Exchange with the same Administrative Group as the earlier

Preparing the Databases

Checking the statues of the database file

in order for the Database portability feature to work. we need the DB's in clean shutdown state. To check the Database State we are gonna be using the  Exchange Server Database Utility's file dump mode

Note : if you are restoring from a windows Backup the Database should already be in a Clean shut down state as the exchange VSS backup re-plays the log files before backing up the DB

More Detail on eseutil /MH - link

Launch command prompt and type

eseutil /MH "D:\Restore\oldDB.edb" (the text in blue is the location of the restored old database file)

 Check the output you get and check if the DB is in a Dirty shutdown or a clean shutdown state

If the DB file is in Dirty shutdown state

In this case we did not have any recent backups and we were not able to soft recover the DB since this is a new DC. so we had to do a hard recovery using this command.

eseutil /P "D:\Restore\oldDB.edb" (the text in blue is the location of the restored old database file)

Click ok on the prompt to continue

Note : using the Hard recovery will result in loss of information depending on the amount of log files you have for that Database

After the Hard recovery to fully rebuild indexes and defragment the database

eseutil /D "D:\Restore\oldDB.edb" (the text in blue is the location of the restored old database file)


Mounting the Database using the Portability feature.


Create a new Database

Create a new Database for example we will create one named -  recoveryDB1

Go to properties of the new DB > Maintenance Tab > Select  the option "This Database can be overwritten by a restore"

Apply the Changes and dismount the Database

Replace the new Database file with the Repaired Database

Firstly go to the folder where the new DB file(recoveryDB1.edb) is located and Rename or delete it

Delete the log files / Catalog files


Rename the Recovered Database

Go to the Folder where the Database we repaired before is located and Rename it to "recoveryDB1"


Replace the newly created Database

Copy the Repaired DB file and replace the new Database file recoveryDB1.edb

Remember the Log files should be deleted or moved before you mount this DB.

Mount the "recoveryDB1" Database From EMC

now the mailStore should be mounted with out an issue

Errors you might run in to
In case you do get errors when mounting the DB such as

Operation terminated with error -1216 (JET_errAttachedDatabaseMismatch, An outstanding database attachment has been detected at the start or end of recovery, but database is missing or does not match attachment info) after 11.625 seconds.

you are getting this error because The DB is in dirty shutdown state, refer to the Preparing the Database Section above to fix the issue by performing a Hard Recovery

unable to mount error 's

The new Database Log files are still present, Delete them or move them.

Now you can go ahead and Attach the Mailboxes to the corresponding user accounts.

Word of advice 

It will be wise to not to keep this recovered Mail Store in production for long. you will run in to various issues as the Mails start to flow in and out

Create new Mail stores's  and Move the mail boxes to avoid future problems.

Some mailboxes might be corrupted. in that case

Easiest way is to use the

New-MailboxRepairRequest” cmdlet

Refer to this tech-net article for more info - link

  • Export it to a PST
  • Attach the user to a fresh mailbox
  • Sync back the Data you need through outlook