A database availability group (DAG), together with mailbox database copies, can provide automatic recovery from a variety of server, storage, network, and other hardware failures. A DAG can also provide a site resilience solution so that you can perform a datacenter switchover in the event of a site-level disaster. But even a comprehensive, intelligent, and robust solution such as a DAG can't protect you from all possible disasters, including disasters that affect an entire DAG.
Example of Exchange Environment
We'll work with a two-member DAG named DAG1 that contains 2 HUB/CAS/Mailbox servers named HCM1 and HCM2. HCM1 hosts the active copy of a database named DAG1-DB1, which is replicated to HCM2. In addition to hosting the passive copy of DAG1-DB1, HCM2 also hosts the active copy of DAG1-DB2, which is replicated to HCM1.
We also have an Edge server in the DMZ.
In this article we'll only focus on the required steps to rebuild an entire DAG, it will not covers the recovery of the Edge server.
Note:
The required steps to bring back the DAG online are different from what is described in this article http://technet.microsoft.com/en-us/library/gg513521(v=exchg.141).aspx as we can start any cleanup operation from the Exchange Management shell because we've lost all the Exchange servers except the Edge that we could not use to perform those tasks.
To be able to perform successfully the recovery you should have documented the following information:
Prepare the DAG for Recovery
In this example we'll start recovering HCM1 first
Build Replacement Mailbox Servers
Run Setup /preparead
Run the following Command
Setup /m:recoverserver /DoNotStartTransport
Perform the Cleanup Operation to Prepare for DAG Recovery
Remove-MailboxDatabaseCopy -Identity DAG1-DB1\HCM2 -Confirm:$False
Remove-MailboxDatabaseCopy -Identity DAG1-DB2\HCM1 -Confirm:$False
Remove-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer HCM2 -ConfigurationOnly:$True -Confirm:$False
Get-DatabaseAvailabilityGroup -Identity DAG1 | Format-List Servers
Add back the servers to the DAG
Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer HCM1
Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer HCM2
Add Mailbox Database Copies to the DAG
The final step is to add mailbox database copies back to the appropriate DAG member. Depending on the nature of the failure, the previously passive copies of the databases hosted on these servers may not be available. If the files on disk are preserved and in their original location or copied to the original location, the Microsoft Exchange Replication service may be able to perform an incremental resynchronization of the passive copies, thereby eliminating the need for a full reseed. However, if the original passive copies aren't available, you'll need to perform a full reseed.
Add-MailboxDatabaseCopy -Identity DAG1-DB1 -MailboxServer HCM2
Add-MailboxDatabaseCopy -Identity DAG1-DB2 -MailboxServer HCM1
Get-mailboxDatabse | Get-MailboxDatabaseCopyStatus
Ghazi Boufaden from NEPA team.