Exchange Server 2010 has a feature called Database Portability. This is the capability for a mailbox database from one Mailbox server to be mounted on another Mailbox server within the same organization.
In this article I will demonstrate how you can use Database Portability in a disaster recovery situation.
First we need to understand a few key points about Database Portability:
- the mailbox database can only be mounted on another Mailbox server within the same Exchange organization
- the mailbox database can’t be from an earlier version of Exchange Server
- the database can’t be a public folder database
In this example scenario a Mailbox server has failed, and another Mailbox server is available to mount the database from the failed server.
There are different approaches that could be taken instead of using Database Portability, such as:
- if the Mailbox server was in a Database Availability Group then the database may be able to be activated on another DAG member that already holds a replica of the database
- in some cases a Mailbox server recovery may be more appropriate
The first step is to get the database and log files onto the server where you want to mount them. This could be done by restoring them from backup, or by attaching the same storage that was on the old server to the new server.
Before we proceed further we need to check what shutdown state the database is in. Open the Exchange Management Shell and navigate to the folder containing the database file. Then run the following command to check the database state.
g:\Data\MB-HO-01>eseutil /mh MB-HO-01.edb | findstr "State:" State: Dirty Shutdown
With a database in a dirty shutdown state, and all of the transaction log files available, we can perform a soft recovery of the database. This commits any uncommitted transaction logs into the database so that there is no data loss. If you don’t have the transaction logs, or your database is in a clean shutdown state, then you can skip this step.
From the folder that contains the transaction logs run the following command, replacing “E00″ with the log file prefix for your database.
F:\Logs\MB-HO-01>eseutil /r E00 /d G:\Data\MB-HO-01 Extensible Storage Engine Utilities for Microsoft(R) Exchange Server Version 14.01 Copyright (C) Microsoft Corporation. All Rights Reserved. Initiating RECOVERY mode... Logfile base name: E00 Log files: System files: Database Directory: G:\Data\MB-HO-01 Performing soft recovery... Restore Status (% complete) 0 10 20 30 40 50 60 70 80 90 100 |----|----|----|----|----|----|----|----|----|----| ................................................... Operation completed successfully in 1.938 seconds.
Note the use of the /d parameter to specify the location of the mailbox database file. This is required if it not in the same path as on the original server.
Create a new mailbox database on the Mailbox server you are using to mount the database. Specify paths for the transaction logs and database file that are different to the current location.
[PS] G:\>New-MailboxDatabase -Server esp-ho-ex2010a -Name MB-HO-01-Recovered -LogFolderPath F:\Logs\MB-HO-01-Recovered -EdbFilePath G:\Data\MB-HO-01-Recovered\MB-HO-01.edb Name Server Recovery ReplicationType ---- ------ -------- --------------- MB-HO-01-Recovered ESP-HO-EX2010A False None
Copy the database and log files from their current locations into the locations that you specified when creating the new mailbox database.
Mark the database as overwritable.
[PS] G:\>Set-MailboxDatabase MB-HO-01-Recovered -AllowFileRestore:$true
Now mount the mailbox database.
[PS] G:\>Mount-Database MB-HO-01-Recovered
At this stage we’ve got the mailbox successfully mounted, but the users with mailboxes on that database are still pointing to the old server and database name.
[PS] G:\>Get-Mailbox -Database MB-HO-01 Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- Administrator Administrator esp-ho-ex2010b unlimited Alan.Reid Alan.Reid esp-ho-ex2010b unlimited Alex.Heyne Alex.Heyne esp-ho-ex2010b unlimited Aisha.Bhari Aisha.Bhari esp-ho-ex2010b unlimited Aleisha.Harrison Aleisha.Harrison esp-ho-ex2010b unlimited
So the final step is to update the attributes for those user accounts to point to the new mailbox database.
[PS] G:\>Get-Mailbox -Database MB-HO-01 | Set-Mailbox -Database MB-HO-01-Recovered Confirm Rehoming mailbox "exchangeserverpro.net/Users/Administrator" to database "MB-HO-01-Recovered". This operation will only modify the mailbox's Active Directory configuration. Be aware that the current mailbox content will become inaccessible to the user. [Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): a
Now we can see that the user accounts have been updated with the new attribute.
[PS] G:\>Get-Mailbox -Database MB-HO-01-Recovered Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- Administrator Administrator esp-ho-ex2010a unlimited Alan.Reid Alan.Reid esp-ho-ex2010a unlimited Alex.Heyne Alex.Heyne esp-ho-ex2010a unlimited Aisha.Bhari Aisha.Bhari esp-ho-ex2010a unlimited Aleisha.Harrison Aleisha.Harrison esp-ho-ex2010a unlimited
The users will now be able to connect to their mailboxes again under the following assumptions:
- The updated user account attributes may need to replicate through Active Directory
- Outlook 2007/2010 and Outlook Web App users will automatically connect to the new database
- Outlook 2003 clients will require a manual profile update to connect to the new database