Mailbox Recovery Exchange 2010

AID: 2975
  • Status: Published

13391 points

  • Bydemazter
  • TypeTutorial
  • Posted on2010-04-27 at 01:01:36
Awards
  • Community Pick
  • Experts Exchange Approved
In previous versions of Exchange Server, we had the recovery storage group, or RSG, which allowed us to restore a copy of the EDB file associated with the Mailbox Database and recover individual mailboxes or mail/calendar/contact items.

In Exchange 2010, we no longer have Storage Groups and therefore no Recovery Storage Group.  Instead we have the Recovery Database.  This Recovery Database can only be mounted on one server at a time.  As Mailbox Databases are not linked to servers they can be mounted on any server within the same Exchange Organisation.

Following on from my article here: http://www.experts-exchange.com/articles/Software/Server_Software/Email_Servers/Exchange/Backing-up-Exchange-2010-Information-Store-using-Windows-Backup.html  where we discussed how the Windows Backup Utility can be used to backup just the EDB and LOG files.  We will now look at how we can use this to restore the EDB file and recover the contents.  We will cover the following:

  • Restore the EDB & Log files
  • Create a Recovery Database from the EDB file
  • Use the ESEUTIL utility to replay the log files
  • Recover the required mailbox/mail items

Restore the EDB & Log files


Using the Windows Server Backup utility (Start > Administrative tools), in the action pane on the right hand side, select Recover.
On the first screen, select the backup location as per the image below.  If you have the backup stored on another drive on the same server then select This Server, otherwise select A backup stored on another location and click Next.
 
restore-01.jpg
  • 57 KB
  • restore-01.jpg
restore-01.jpg

The next screen you see (image below) will be asking you the location of the backup you want to restore.  Choose either Local drives or Remote shared folder.  Click Next.
 
restore-02.jpg
  • 51 KB
  • restore-02.jpg
restore-02.jpg

Make your selection and click next.  On the following screen you will have to provide the location of where the backup is stored.  This will be different depending on the location you specified on the previous screen.  Locate your backup and click next.
The next screen will be the date selection that you want to restore from (image below).  Select the date from the calendar and the time the backup was taken, and then click next.
 
restore-04.jpg
  • 74 KB
  • restore-04.jpg
restore-04.jpg

Select the files and folders option from the following screen (there is no need to restore the full volume) and click next.  You will see a full list of files and folders as displayed below.  You need to select the files from the list.  Make sure you select all the contents of the folder where the mailbox store is stored.  Including the log files.
 
restore-06.jpg
  • 101 KB
  • restore-06.jpg
restore-06.jpg

Once you have made the selection, click next. The following screen will ask you where you want to store the recovered data.  Complete the detail and then click next.  On the final screen click recover.

Create a Recovery Database from the EDB file


Once we have restored the EDB file and Log files, we then need to create a Recovery Database.  This process can only be performed using the Exchange Management Shell.
Assuming the following Information:
  • Servername is WIN2008R2 (must be an Exchange Server that holds the Mailbox Role)
  • The EDB & Log files have been restored to C:\EDBRestore\
  • EDB File Name is Mailbox Database 2012387847.edb
  • The recovery database name will be RecoveryDatabase1

Run the following command in the Exchange Management Shell:
 New-MailboxDatabase -Recovery -Name “RecoveryDatabase1” -Server WIN2008R2 -EdbFilePath “C:\EDBRestore\Mailbox Database 1.edb" -LogFolderPath "C:\EDBRestore"
                                    
1:

Select allOpen in new window


Once you run this command you will see an output similar to the image below.
 
new-mailboxdatabase.jpg
  • 49 KB
  • new-mailboxdatabase.jpg
new-mailboxdatabase.jpg

This will create the Recovery Database.  We can confirm the database has been created and that it is a recovery database by running the following command from the Exchange Management Shell:
Get-MailboxDatabase
                                    
1:

Select allOpen in new window


This will display an output similar to the image below.
 
get-mailboxdatabase.jpg
  • 21 KB
  • get-mailboxdatabase.jpg
get-mailboxdatabase.jpg

The important part of this screenshot is that the database listed as RecoveryDatabase1 has the value of True under the Recovery setting.

We now have a recovery database created.  The next step is to replay any log files we have to bring the store up to date.

Use the ESEUTIL utility to replay the log files


The EDB file we have restored will not include any data that is contained in the log files as these are committed to the database AFTER we perform the backup.

The utility we use to perform the replay is ESEUTIL, this utility is the same in all versions since Exchange Server 2000.

We need to know the log file numbering before we can run ESEUTIL.  To do this, navigate to the folder you restored the EDB & Log files to (in the case of this article it is C:\EDBRestore) and look for the file that starts with an E and has 2 numbers after the E and an extension of .chk, so for example E00.chk.  This is what is known as the checkpoint file, or the working log file.  All the other log files will start with the same 3 digits and they are created when the checkpoint file gets full.

So assuming your checkpoint file is called E00.chk we now need to run the command to replay the log files in the Exchange Management Console.
Once the Exchange Management Shell is open type the following commands:
Cd \ <enter>
CD EDBRestore
ESEUTIL /R E00 /I /D
                                    
1:
2:
3:

Select allOpen in new window


This will replay the log files that you have restored from the backup into the database.  

The final part of this step is to mount the Recovery Database.  To do this we run the following command from the Exchange Management Shell:
Mount-Database RecoveryDatabase1
                                    
1:

Select allOpen in new window


We are now in a position to restore the required data.

Recover the required mailbox/mail items


Unlike previous versions of Exchange, there is no Graphical User Interface for the recovery process.  To recover mail items we need to use the Exchange Management Shell.

So for example, we have a user called mark_wills and he has deleted the entire contents of his mailbox and you need to recover all his mail.

We have a copy of the mailbox belonging to mark_wills in our Recovery Database.  To restore the required mailbox, we would use the Exchange Management Shell and run the following command:
Restore-Mailbox -Identity mark_wills -RecoveryDatabase RecoveryDatabase1
                                    
1:

Select allOpen in new window


This will recover a mailbox called mark_wills from the Recovery Database called RecoveryDatabase1 to the mark_wills mailbox in the live database.  This method relies on the original mailbox still being in tact.
The next option is to recover the mark_wills mailbox from the Recovery Database and place it into a folder called "mark_wills Recovery" within a mailbox called tigermatt.
Restore-Mailbox -Identity tigermatt -RecoveryDatabase RecoveryDatabase1 -RecoveryMailbox mark_wills -TargetFolder “mark_wills Recovery”
                                    
1:

Select allOpen in new window


We also have the ability to search the mailbox content for keywords.  In this example we search for any messages containing the word “demazter” and restore those items to a folder called “mark_wills recovery with demazter text” within a mailbox called alanhardisty.  To do this we would run the following command:
Restore-Mailbox -Identity alanhardisty -RecoveryDatabase RecoveryDatabase1 -RecoveryMailbox mark_wills -SubjectKeywords "demazter" –TargetFolder “mark_wills recovery with demazter”
                                    
1:

Select allOpen in new window


    Asked On
    2010-04-27 at 01:01:36ID2975
    Tags

    recovery database

    ,

    RSG

    ,

    Exchange 2010

    ,

    recover mailbox

    ,

    restore-mailbox

    ,

    backup

    ,

    restore

    Topic

    Exchange Email Server

    Views
    18980

    Comments

    Expert Comment

    by: Tpm1973 on 2010-10-21 at 08:10:06ID: 20681

    hello,

    i have already done all this, but my problem is the last point:

    Recover the required mailbox/mail items

    i don't want to restore the mailbox to a "subfolder" in a existing other mailbox;
    or overwrite/merge my origional mailbox, ...

    i want't to restore/export my mailbox to a .PST file.

    thx!

    Expert Comment

    by: lucid8 on 2010-10-22 at 06:09:40ID: 20705

    Unfortunately you have to run through the restore process first to an existing live mailbox and only then can you export the data to PST.

    Troy Werelius

    Expert Comment

    by: wasim-shaikh on 2010-11-22 at 11:35:24ID: 21531

    If I am wrong please correct me.
    E00.chk keeps info about the logs that has been written to database, is it really the current log file to which data is written when exchange is online?
    If its not the current log then I will request you to please correct it in the article.

    Thanks.

    Author Comment

    by: demazter on 2010-11-22 at 12:20:32ID: 21532

    wasim-shaikh,

    You are correct, the checkpoint file keeps the information about what log files have been committed to the database.

    The sentence you are refering to "All the other log files will start with the same 3 digits and they are created when the checkpoint file gets full." does need to be re-worked.  The flow of the previous sentence must have got away with me.

    I will update the article as soon as I can.

    Thanks
    demazter

    Expert Comment

    by: kitsao on 2011-06-15 at 02:51:18ID: 28693

    hi,
    I have corrupted mailbox databases (errorcode 1018) and no Backups of it. Is there any chance to recover it?

    I'm moving all e-mail the users already have from their mailboxes to pst's and then I'll re-install Exchange 2010. So I think the loos won't be too big.

    Is that a good idea?

    Expert Comment

    by: kitsao on 2011-06-15 at 05:38:28ID: 28698

    hi,

    Created a new mailbox database and solved the problem!

    Thanks!

    Expert Comment

    by: lucid8 on 2011-06-15 at 05:49:57ID: 28699

    Excellent

    Expert Comment

    by: jjdurrant on 2011-06-24 at 06:01:44ID: 29089

    Great article!

    Expert Comment

    by: carolchi on 2012-01-07 at 07:18:05ID: 34265

    could we have NewMailboxRestoreRequest too?

    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top Exchange Experts

    1. demazter

      724,144

      Sage

      1,580 points yesterday

      Profile
      Rank: Genius
    2. alanhardisty

      714,931

      Sage

      4,220 points yesterday

      Profile
      Rank: Genius
    3. jjmck

      275,745

      Guru

      1,030 points yesterday

      Profile
      Rank: Genius
    4. Rajkumar-MCITP

      268,093

      Guru

      0 points yesterday

      Profile
      Rank: Guru
    5. apache09

      245,757

      Guru

      1,500 points yesterday

      Profile
      Rank: Genius
    6. akicute555

      178,820

      Guru

      0 points yesterday

      Profile
      Rank: Wizard
    7. amitkulshrestha

      171,436

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    8. acbrown2010

      159,135

      Guru

      1,000 points yesterday

      Profile
      Rank: Genius
    9. Akhater

      153,366

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    10. Neilsr

      137,804

      Master

      0 points yesterday

      Profile
      Rank: Genius
    11. jordannet

      127,611

      Master

      10 points yesterday

      Profile
      Rank: Wizard
    12. GreatVargas

      101,542

      Master

      2,800 points yesterday

      Profile
      Rank: Wizard
    13. HendrikWiese

      95,084

      Master

      2,050 points yesterday

      Profile
      Rank: Sage
    14. limjianan

      94,700

      Master

      0 points yesterday

      Profile
      Rank: Genius
    15. endital1097

      93,710

      Master

      10 points yesterday

      Profile
      Rank: Genius
    16. Anuroopsundd

      92,000

      Master

      0 points yesterday

      Profile
      Rank: Sage
    17. davorin

      91,351

      Master

      0 points yesterday

      Profile
      Rank: Sage
    18. Radweld

      88,729

      Master

      0 points yesterday

      Profile
      Rank: Guru
    19. chakko

      88,498

      Master

      0 points yesterday

      Profile
      Rank: Genius
    20. R--R

      86,699

      Master

      0 points yesterday

      Profile
      Rank: Wizard
    21. e_aravind

      85,998

      Master

      0 points yesterday

      Profile
      Rank: Genius
    22. Exchange_Geek

      85,704

      Master

      0 points yesterday

      Profile
      Rank: Sage
    23. lucid8

      81,809

      Master

      0 points yesterday

      Profile
      Rank: Sage
    24. KalluSureshKumar

      76,534

      Master

      0 points yesterday

      Profile
      Rank: Master
    25. tigermatt

      73,020

      Master

      0 points yesterday

      Profile
      Rank: Genius

    Hall Of Fame