Posts Tagged Backup

Exchange 2010 Recovery Database

Posted by on Tuesday, 29 June, 2010

Legacy Exchange Recovery Storage Groups

Exchange 2010 no longer includes the concept of storage groups. In earlier versions of Exchange, one or more Exchange store databases can be grouped into a storage group, which can then be managed as a unit. However, storage groups complicate many high-availability scenarios, and make single-database restores more complex.

Exchange 2010–compatible backup and restore applications that work with the Windows Volume Shadow Copy Service (VSS) no longer provide storage group identifiers in the VSS backup component paths.

Recovery Storage Group Replaced with Recovery Database

Because storage groups were removed from Exchange Server 2010, the recovery storage group no longer exists. Instead, if your application needs to restore, recover, and mount an Exchange database to a different location or server, it will use a recovery database. The recovery database is not tied to any original server or database. Each Exchange 2010 server can have no more than one mounted recovery database. There can be multiple recovery databases, but only one can be mounted at a time.

You can use the Restore-Mailbox cmdlet to extract data from an RDB. After extraction, the data can be exported to a folder or merged into an existing mailbox. RDBs enable you to recover data from a backup or copy of a database without disturbing user access to current data.

Microsoft Exchange Server 2010 supports the ability to restore data directly to a recovery database. Mounting the recovered data as a recovery database allows the administrator to restore individual mailboxes or individual items in a mailbox. Restoring to a recovery database can be accomplished in two ways:

  • If a recovery database already exists, the application can dismount the database, restore the data onto the recovery database and log files, and then remount the database.
  • The database and log files can be restored to any disk location. Exchange analyzes the restored data and replays the transaction logs to bring the databases up to date, and then a recovery database can be configured to point to already recovered database files.

 

Steps how to restore a mailbox

1.   Restore EDB, Logs and Replay the logs

First you have to Recover the edb and log files to a recovery directory. We have restored the files to D:\restore

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.

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 D:\Restore) 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 Restore
ESEUTIL /R E00 /L “path of logfiles” /D “Path of database” /i

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

When you don’t use the /i you might get this error:

“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 n seconds.”

To resolve this, run soft recovery with the “/i ” switch at the end and it will override the EDB-STM mismatch.

You also may Use /a . Use the /a – allow recovery to lose committed data if database integrity can still be maintained.

Run Eseutil /mh “Path of the database *.edb” to check if the database is in a state: Clean shutdown

2.   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 MBX1 (must be an Exchange Server that holds the Mailbox Role)
  • The EDB & Log files have been restored to D:\Restore\
  • EDB File Name is databases01.edb
  • The recovery database name will be RecoveryDatabase01

Run the following command in the Exchange Management Shell:

[PS] New-MailboxDatabase -Recovery -Name “RecoveryDatabase01” -Server MBX1 -EdbFilePath “D:\Restore\Databases01.edb” -LogFolderPath “D:\Restore”

If there are problems to mount the recovery databas. Use the /a – allow recovery to lose committed data if database integrity can still be maintained.

[PS] New-MailboxDatabase -Recovery -Name “RecoveryDatabase01” -Server MBX1 -EdbFilePath “D:\Restore\Databases01.edb” -LogFolderPath “D:\Restore”

 

The next step is to mount the Recovery Database.  To do this we run the following command from the Exchange Management Shell:

Mount-Database RecoveryDatabase01

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

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.  

 

3.    Show list of mailboxes in the recovery database

To show all the mailboxes which are in the recovery database use the following command from the Exchange Management Shell:

[PS] Get-MailboxStatistics -Database RecoveryDatabase01 

 

4.   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.

4.1 Restore the completed mailbox

So for example, we have a user called Rene_vm 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 Rene_vm in our Recovery Database.  To restore the required mailbox, we would use the Exchange Management Shell and run the following command:

[PS] Restore-Mailbox -Identity rene_vm -RecoveryDatabase RecoveryDatabase01

This will recover a mailbox called rene_vm from the Recovery Database called RecoveryDatabase01 to the rene_vm mailbox in the live database.  This method relies on the original mailbox still being intact. 

4.2 Restore to a Folder

The next option is to recover the rene_vm mailbox from the Recovery Database and place it into a folder called “Rene_vm Recovery” within a mailbox called servicedesk.

[PS] Restore-Mailbox -Identity servicedesk -RecoveryDatabase RecoveryDatabase01 -RecoveryMailbox Rene_vm -TargetFolder “Rene_vm Recovery”

4.3 Restore selective Mail

Restores only the mail with the subject more2know, with the message body containing the word business, and with the message location either in the Inbox or Calendar folder. This example assumes that the mailbox is in English. Place the restored items into a recovery folder.

[PS] Restore-Mailbox -Identity info -RecoveryDatabase RecoveryDatabase01 -RecoveryMailbox rene_vm -SubjectKeywords “more2know” –ContentKeywords “business” –IncludeFolders \inbox,\calendar –TargetFolder “Rene_vm recovery with more2know”

4.4      Bulk Restore

Bulk restores all the mailboxes in the Databases01 mailbox database that are also present in RecoveryDatabase01

[PS] Get-Mailbox -Database Databases01 | Restore-Mailbox -RecoveryDatabase RecoveryDatabase01

 

5.   Removing the recovery database

After the restore is completed we must remove de recovery database. To do this we would run the following command:

[PS] Remove-MailboxDatabase -Identity RecoveryDatabase01

 

For more information see also the technet sites from microsoft:
Recovery Databases http://technet.microsoft.com/en-us/library/dd876954.aspx
Understanding Backup, Restore and Disaster Recovery http://technet.microsoft.com/en-us/library/dd876874.aspx
Restore-Mailbox http://technet.microsoft.com/en-us/library/bb125218.aspx