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


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





11 comments:

  1. Hi Malinda,

    Thanks for the step by step guide to recover database from Dirty-shutdown state. In this critical situation data becomes completely out of reach from the Exchange server users and possibly data loss. Although Eseutil tools are their but these utilities can be dangerous in hands of a novice user or a non-technical person. I would suggest to read carefully various guides and articles, available online before running these tools.

    For a novice user or to avoid the data loss situation it is good to go for a third party Exchange recovery tool like Stellar Phoenix Exchange recovery software . This application has easy to use GUI and effectively handles all data loss situations.

    thanks
    Tim

    ReplyDelete
  2. you are most welcome ;D . for a novice user who have the budget can of course recover with a 3rd party tool. but if you have a backup it wont hurt to to try to do it using ESEUTIL

    ReplyDelete
  3. We are facing a technical issue while crating Recovery databases.

    The problem scenario is as follows.
    1. User provides transaction log file folder path and edb file path and creates a Recovery database.
    2. As a result of creating Recovery database, new log files are generated in log folder.
    3. User dismounts and removes the recovery database from exchange.
    4. User again provides the same transaction log file folder path and edb file path to create a Recovery database.
    5. Recovery db creation fails with the following error
    "The location that you specified for the transaction log files is invalid. Verify that the directory exists and that there are no files in it."
    6. User deleted the log files generated in step 2 but keeps original log files as it is.
    7. User tries to create recovery database as in step 4. This time creation is successful.

    We modify the exception generated in Step 5 for the time being, to a user friendly message "Please cleanup the log file folder and restore the
    log files from backup to the log file folder".

    We are trying to find a suitable fix for this.


    sumit naik(mail at : [email protected])

    ReplyDelete
    Replies
    1. Hi

      I think you got it messed up from step 2

      Create a fresh Database

      unmount it (do not delete or remove it from EMC)

      go to the folder delete the Log files

      Replace the new DB (.edb) file with the old Recovered DB (The old db has to be prepared by running a Hard recovery using eseutil before you proceed with this step)

      Mount the new DB on EMC

      Attach the Mailboxes to the user accounts


      Delete
    2. Hi Sumit,

      You can try another method as third party software Stellar Phoenix Exchange Server Recovery to recover database from Exchange Server and avoid this corruption issues. Software repairs your corrupt EDB file data & Recover all mailboxes from Exchange Server. You can download demo version from here: http://www.stellarinfo.com/edb-exchange-server-recovery.htm

      Delete
  4. Thanks for sharing this software. I would like also to suggest to one more utility which i got from Google. visit the url to get more information.


    http://www.recoverydeletedfiles.com/exchange-server-edb-recovery.html


    Thanks

    ReplyDelete
  5. Hi Malinda, I wonder that what does “◾the mailbox database can only be mounted on another Mailbox server within the same Exchange organization” means???

    In my scenario, my company have an exchange organization with domain name DOMAIN.com. But now, we want to shutdown this Exchange 2010 Organization and build a totally new exchange server 2010 organization wit the same domain name DOMAIN.com, the only thing we save is the Mailbox Database .edb file. So with your opinion, could I copy the .edb file from the OLD Mailbox server to an Storage device and copy, mount it on a NEW Mailbox server following your instruction.

    Thanks and Regards !
    Pham

    ReplyDelete
    Replies
    1. As far as i can see You can change the AD-Domain name

      but when installing exchange use the same Organization name. else the DB portability feature wont work as described above.

      if its not possible to use the same exchange organization name. you will have to export mailboxes to PST and upload. which is very boring and painstaking task. we had to go though this during a DR situation of one of our clients

      you can use 3rd party tools for this which will be ease your pain google around you will find some good ones that fits your budget

      Delete
  6. Use Exchange Recovery solution that repairs and convert EDB data in PST file format. This is best solution for recovering EDB files and converting in PST file format easily.
    For more information and free download click http://exchangerecoverytools.blogspot.com

    ReplyDelete
  7. Thanks for sharing helpful information, I found good information at http://www.exchangemailboxrecovery.co.uk about how to recover exchange mailbox data form exchange server. It recovers permanently deleted mailbox data and convert to accessible outlook pst files data.

    ReplyDelete
  8. Back in May of 2008 out at the Claremont Resort in Berkeley,click here CA, Rakesh Agrawal and 26 other unmistakable database scientists got together to discuss this very issue. What left this gathering is the thing that you have to know.

    ReplyDelete