Community Pick: Many members of our community have endorsed this article.
Editor's Choice: This article has been selected by our editors as an exceptional contribution.

Mailbox Recovery Exchange 2010

Glen KnightLead Techical Consultant
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:  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.jpgThe 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.jpgMake 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.jpgSelect 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.jpgOnce 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"

Open in new window

Once you run this command you will see an output similar to the image below.
  new-mailboxdatabase.jpgThis 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:

Open in new window

This will display an output similar to the image below.
  get-mailboxdatabase.jpgThe 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

Open 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

Open 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

Open 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”

Open 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”

Open in new window

Glen KnightLead Techical Consultant

Comments (11)

Justin DurrantSr. Engineer - Windows Server/Virtualization

Great article!
Carol ChisholmCarol Chisholm (carolchi)

could we have NewMailboxRestoreRequest too?

Can this be used to restore Contacts?

Restore-Mailbox -Identity “fname lname" -includefolders “\Contacts” -RecoveryDatabase RDB1 -RecoveryMailbox “fname lname" -TargetFolder Recovery

The command runs for about 1 second, creates a folder in \Recovery\Recovered Data - Fname Lname - 09/12/2012 11:37:15  however the folder is empty.

Is there anything special needed to restore the Contacts folder?
see attached screenshot. i am getting an error regarding New-MailboxDatabase

View More

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.