In this post I will demonstrate how to use Windows Server Backup to backup and restore a mailbox database for Exchange Server 2010.
There are three parts to this tutorial:
- Installing Windows Server Backup on Windows Server 2008 R2
- Backing Up an Exchange 2010 Mailbox Database
- Restoring an Exchange 2010 Mailbox Database
The server I am using is running Windows Server 2008 R2 and has Exchange Server 2010 installed with the Mailbox server role. A single mailbox database has been configured, and one mailbox exists in the database.
Watch the video here or scroll down for the complete step by step process.
Installing Windows Server Backup on Windows Server 2008 R2
Windows Server Backup is not installed by default, so the first step here is to install it. Open an elevated Powershell session and run the following commands.
PS C:\> Import-Module servermanager PS C:\> Add-WindowsFeature backup
Windows Server Backup can now be launched from the Administrative Tools menu.
Backing Up an Exchange 2010 Mailbox Database
If the server that will run the backup is a DAG member and you are using Windows Server Backup there is a registry change required first. See Windows Server Backup Completed with Warnings for Exchange 2010 Mailbox Server.
From the Windows Server Backup window click on Backup Once.
There is no existing scheduled backup on this server, so Different Options is the only selection. Click Next to continue.
At the next step I’m choosing a Custom configuration so that I can look closer at the volumes to be backed up. Click Next to continue.
Now it is time to select the volumes to be backed up. For an Exchange Server 2010 mailbox database backup we need to choose any volumes that have Exchange database or log files on them. The entire volume needs to be backed up, not just the folder holding those files.
Click the Add Items button to open the selections dialog.
In this case the mailbox database is on volume D:, while the transaction logs are on volume C:, so both volumes are selected. Click OK to close the dialog.
Next click the Advanced Settings button.
Select the VSS Settings tab and make sure that VSS full backup is chosen. Click OK and then Next to continue.
The backup can be stored on either a local drive or a remote network share. In this demonstration I’m backing up to a local drive.
Select the volume to back up the Exchange 2010 mailbox database to. You can’t choose a volume that is part of the backup selections list. Click Next to continue.
When you are happy with your selections click Backup to start the backup.
The time taken to backup will depend on the size of your mailbox database.
When the backup is complete click the Close button.
Verify that the backup was successful. You can also click the View Details link to see more information.
Restoring an Exchange Server 2010 Mailbox Database
For this demonstration the mailbox database has been dismounted and the database file deleted. The Exchange server is unable to mount the database due to the missing file.
The mailbox database needs to be recovered from the previous good backup. But first we need to mark the mailbox database as restorable. In the Exchange Management Console open the properties of the mailbox database.
Select the Maintenance tab and tick the box This database can be overwritten by a restore.
You can also use the Exchange Management Shell to perform this task.
[PS] C:\>Set-MailboxDatabase "Mailbox Database EX2 01" -AllowFileRestore $true
In Windows Server Backup click on Recover to start the Recovery Wizard.
The previous backup is stored on the local server in this case. Click Next to continue.
A calendar is displayed with all of the dates that backups occurred on highlighted in bold. If more than one backup was taken on that date then there are multiple entries in the drop down list. Choose the backup that you want to restore from, usually the most recent one. Click Next to continue.
The recovery type for an Exchange 2010 mailbox database restore is Application. Select the recovery type and click Next to continue.
Windows Server Backup detects the type of application that was backed up and shows you a list. Because this is the most recent Exchange server backup it also offers the option to not roll forward the database once the restore has been completed. This means that the transaction logs that were written on the server since the time of the backup will be replayed into the restored database, bringing it completely up to date.
If you don’t want to roll the database forward (ie you are trying to recover the database to a specific point in time) then tick the box. Otherwise click Next to continue.
In this example we’re recovering a lost database, so we will be restoring it to the original location. If you do not want to overwrite an existing database you can choose to restore to an alternate location instead. Click Next to continue.
When you’re ready to proceed click Restore to begin the recovery.
The restore time will depend on the size of the mailbox database being recovered. When the restore is complete click on Close.
In the Application Event Log of the server we can see the recovery operation has taken place.
First the restore is begun:
Log Name: Application Source: MSExchangeIS Date: 12/4/2010 8:51:30 PM Event ID: 9725 Task Category: Exchange VSS Writer Level: Information Keywords: Classic User: N/A Computer: EX2.exchangeserverpro.local Description: Exchange VSS Writer will restore a backup set to database 'Mailbox Database EX2 01', which is the same database from which the backup was originally taken.
Then the restore is completed successfully:
Log Name: Application Source: MSExchangeIS Date: 12/4/2010 8:51:40 PM Event ID: 9756 Task Category: Exchange VSS Writer Level: Information Keywords: Classic User: N/A Computer: EX2.exchangeserverpro.local Description: Exchange VSS Writer successfully restored the backup set to database 'Mailbox Database EX2 01'. To bring the restored databases to a clean-shutdown state, database recovery will be performed using the information in the restore environment document 'C:Program FilesMicrosoftExchange ServerV14MailboxMailbox Database EX2 01E00restore.env'.
The existing transaction log files are then replayed into the database to roll it forward:
Log Name: Application Source: ESE Date: 12/4/2010 8:52:15 PM Event ID: 301 Task Category: Logging/Recovery Level: Information Keywords: Classic User: N/A Computer: EX2.exchangeserverpro.local Description: Information Store (2608) Mailbox Database EX2 01: The database engine has begun replaying logfile C:Program FilesMicrosoftExchange ServerV14MailboxMailbox Database EX2 01E000000004D.log.
And finally the mailbox database is mounted:
Log Name: Application Source: MSExchangeIS Mailbox Store Date: 12/4/2010 8:52:32 PM Event ID: 9523 Task Category: General Level: Information Keywords: Classic User: N/A Computer: EX2.exchangeserverpro.local Description: The Microsoft Exchange Database "Mailbox Database EX2 01" has been started. Database File: D:Program FilesMicrosoftExchange ServerV14MailboxMailbox Database EX2 01Mailbox Database EX2 01.edb Transaction Logfiles: C:Program FilesMicrosoftExchange ServerV14MailboxMailbox Database EX2 01 Base Name (logfile prefix): E00 System Path: C:Program FilesMicrosoftExchange ServerV14MailboxMailbox Database EX2 01 (Start Duration=00:00:03.032)
The mailbox database has now been recovered.