Microsoft Exchange is very much a process oriented product.
When you don’t follow the proper procedure (go off best practices, if you will), you may find a different way to accomplish the task, but this alternate version is typically what I like to call “Messy” and may not work as you expect. I’m going to show you how to create a recovery database in Microsoft Exchange 2010 the messy way.
When backing up Exchange, you should always backup individual mailboxes and the Directory Store Database. This lets you restore a mailbox or e-mail easily depending on the software you use. I’ve run in to a couple situations where the backup software being used doesn’t create a backup for the mailboxes correctly.
Also I’ve found that some managers neglect the mailbox backup due to saving space or the time it would take to create the backup for the mailboxes. But what happens when you just backup the store, not the mailboxes, and a user needs his mailbox restored? Well, now you’re in a pickle. You can restore everybody back to whenever the earliest Directory Store which may set everyone’s e-mail back days even weeks. Really, that’s not an option.
Luckily, there is a possible “Messy” way to do this. You can create a Recovery Database.
Creating an example Recovery Database for Exchange:
- The server name used is: messy01
- The recovery Database is:RDB1
- The mailbox to be recovered is: Archive Master
First load up the Exchange Management Shell and then run the following command from the prompt:
New-MailboxDatabase -Recovery -server messy01 -Name RDB1 -EdbFilePath “F:\Recover\RDB1\RDB1.edb” -LogFolderPath “F:\Recover\RDB1\logs”
When this has completed, let’s confirm RDB1 has been created. Run the below command to confirm this:
Get-MailboxDatabase -Server messy01
Okay, now that we have confirmed this, you’ll need to set the DB so that you can restore your backup of the Directory Store to RDB1. Run the following command:
Set-MailboxDatabase -Identity RDB1 -AllowFileRestore $true
With that out of the way, we need to wait 20 minutes so that Replication can take place. A common mistake I see is that people get in hurry and we get an error because the AD has not replicated. After 20 minutes, you can now restore from your software. Once you’ve restored your Directory Store data to the RDB1 database, you need to mount the Database. Use the below command to mount the DB:
Now you have a recovery DB loaded in your Exchange system.
From here you can do several things: Recover a mailbox, export a mailbox to a pst, import the pst back in to a mailbox, etc. The best way really is to export the mailbox to a pst file. This will allow you some flexibility once you have the data. For example, you can attach the pst to an Outlook client or import it in to a mailbox if you wish.
Below is a command to run if you need the Mailbox exported as we said earlier:
The mailbox to be recovered is: Archive Master
New-MailboxExportRequest -SourceDatabase RDB1 -Mailbox Archive Master -FilePath \\messy01\pst\AMaster2.pst
This would need to be run after you restore your Directory Store to the Recover DB.
My opinion is that a recovery database method should only be run in case of an absolute emergency. You may need to play with different options as I said before because this is the “Messy” way to do this and you may find that some options work while others do not. I’ve done this myself five times and three out of the five worked perfectly. The other two were the definition of Messy…