Pages

Wednesday, October 22, 2014

Exchange 2010 Mailbox Backup & Recovery with Window Server Backup

For most businesses today, e-mail is the preferable communications tool that allows their people to communicate with each other and share much information.
Each user Mailbox is stored on the Exchange Server Mailbox Database. So, it is necessary to backup the Exchange Database regularly. Mailbox server backups are the most important of all Exchange Server 2010 roles, in an organization. Although, in Exchange Server 2010, deploying a Database Availability Group reduces this risk, somewhat due to the replication of data between multiple servers. It is always recommended to backup databases anyway. However, as a general statement, without the backup of databases there is a risk of critical email and public folder information being lost in a disaster. This makes the databases, another, if not the most important part of your Exchange Server 2010 backup strategy.
In short, as an Exchange Server administrator you need to make sure your servers are being backed up correctly.

Why You Need to Backup the Exchange Server

There are many reasons to Backup your Exchange Server mailbox database. Some are listed below:
  • If any file has been corrupted, then you need to recover it. If you have a backup, then you can easily recover it.
  • In case, you are migrating one database to another or from one version to another, there is a risk of losing the data. But, if you have a backup of your file, it can be recovered easily.
  • If there is any kind of disaster in an organization, there is a possibility of data loss. So if you have a backup, then you can recover it using a built-in feature or by third party tools.

   How to Backup Exchange Server 2010 Mailbox with Windows Server Backup

Windows Server Backup Feature is not installed with your Windows Server,by default, so we need to install it. You can go with the Window Server Backup "Add Feature" or by Power Shell.Both are explained below:

  
Install the Windows Server Backup Feature on the Local Computer
    By using PowerShell:
  1. Run Windows PowerShell
  2. Enter “Import-Module server manager” on command prompt.
  3. Run “Add-Windows Feature backup-features”.
  4. Now installation is in processing, wait till its completion.
The expected outcome is shown in Figure:


After successful completion, now you are able to find “Windows Server Backup” in your Administrative Tools. Run it.

Steps For Backing-Up Exchange databases

Till now, you should have successfully installed Windows Server Backup on the Mailbox Server, and you should have it running and ready to be configured.

Step1. Open Windows Server Backup from the programs folder

Now,select “Backup Schedule” or “Backup Once”, depending on your requirements. In this blog, I choose the “Backup Once” and proceed , as shown in the figure, but both are fairly similar.

As I have selected “Backup Once”, so in the next screen, I will only be left with one option that is to select “Different Options”; proceed with it and then click on Next.
Step 2. Choose"Different Options" , Click "Next”


Step 3. “Select Backup Configuration”, choose “Custom”

For backup of all volumes, “Full server" is recommended. With "custom," specific volumes can be selected for backup, on the next screen. Volumes which include operating system, applications, or components are backed up by default.


Step 4. Select Item for Backup

In the whole configuration, this is the most important part. Let’s start by clicking on “Add Items” and select the folder holding your Mailbox Databases and their associated log files, as shown in figure. By default, In Exchange 2010, this folder is located at C:\Program Files\Microsoft\Exchange Server\V14\Mailbox.

Note: Windows Server Backup 2008 R2 come with a new feature, is that you can now select individual folders to backup, instead of entire volumes. And In this blog, I’ll explain this feature also.
    Figure: Select folders to Backup


After selection of mailbox folders, before you go to the next screen, click on “Advanced settings” and then “VSS Settings”, making sure to select “VSS Full Backup” as shown in figure:
    Figure: VSS Full Backup

If you want backup on Local Drive, You can. But here, I select a remote shared folder.

Figure : Specify Destination Type

Select the destination folder (shared folder) where you want to backup your Mailbox Database.
     
       
Figure : Specify Remote Folder 



   Figure : Backup Progress

Finally, confirm your backup options, and wait for the process to finish.

By now you have learned how to backup Exchange Server 2010 from built-in feature of Window Server 2008 or 2008 R2, now it’s time to recover the data. There are two different situations where you perform the restore process, they are described as below:

  • When You have lost complete data of one database So you need full recovery and
  • You need to recover a single item from a Mailbox.
Here is the step by step procedure for doing so; the screenshots are taken from an Exchange 2010 DAG running on Window 2008 R2.


Full Mailbox database recovery 

Here is a scenario by which you can understand easily. Let’s start by taking a look at the mailbox of user2; you can see from figure 1, new email was received at 3:06pm, which is just after the backup was taken:

   Figure 1 : User2’s mailbox before the crash

For our understanding, crash the database where user2’s mailbox resides by simply deleting its .edb file. Here I only deleted the .edb file only and not any log files, because these files will be used later on to recover data that was sent/received between the backup and the crash (like the most recent email mentioned above).
Now, with typical scenario where the database has been “corrupted”, and we have left is the latest backup (taken at 3:01pm in our case), and the log files covering the time window between the backup and the crash (which was at 11:46pm). Now the question is How to recover the data?

1. Select Recover

To start with the recovery process, run Windows Server Backup and select “Recover” from the action pane, as shown below:


   Figure 2 : Select Recover from the Windows Server Backup

2. Select backup files location

Next, you have to choose the location of your backup files. Our backup files are stored on a remote computer, but the backup was taken on the same machine we are restoring data to. So, you can just keep “This server (Server name)” selected, as shown in figure 3:
   Figure 3 : Select backup files location

3. Select Backup Date

In calendar page, show all available backups. You simply need to select the one which you want to restore from. All date when backups were taken will be in bold, and for us the only backups available are on June 4th; in addition, if there are many backups on the same date, they all are presented through the “time” drop-down menu which is in the right of the calendar. Select the backup which you want to recover. Here in my case it is 3:01pm, so I will select it, and please notice how the correct location is automatically retrieved.
   Figure 4 : Select Backup Date

4. Select Recovery Type

Analyze the screen and pay attention (shown in figure 5); notice “Applications” option is dimmed? This is because, we take the backup at folder level not at volume level.
   Figure 5 : Select Recovery Type

5. Select Recovery Type "Applications" enabled

If you have selected volume while taking your backup , then the “Applications” option would be enabled (as in figure 6),

   Figure 6 : Select Recovery Type "Applications" enabled

However, in our case “Applications” is dimmed. We choose “Files and folders”, and then select the folder containing the corrupted .edb database that we need to recover.

6. Select Items to recover

   Figure 7 : Select Items to recover

7. Specify Recovery Options “Original Location”

Due to complete database loss, will restore it to its original location and overwrite any existing file with the recovered version.

 
   Figure 8 : Specify Recovery Options “Original Location”

8. Recovery Progress

At this stage,wait for the restore to finish:
   Figure 9 : Recovery Progress

9. All files after recovery

After completion of successful restore process, time to take a look at the original location of the database that will reveal that the .edb file is back in place, and all the log files generated between the backup and the crash are still there.

   Figure 10 : Database & Log files after recover

If you want to check the status of the database that was just recovered then run this command:Eseutil /mh “Mailbox Database.edb”

Notice that it is in a “Dirty Shutdown” state, as shown in figure 12 below; which is a good news, because it will notify us to replay the log files up till the crash time, and so not losing the data.

     
     F
igure 11 : Recovered database in "Dirty Shutdown" state.

    Figure 12 : Event Log during log replay

Finally, after the completion of restore process, take a look at the mailbox of User2 again. By the help of log replay, we can see a complete recovery of all the data. Even the email that was received after the backup was recovered.

   Figure 13 : user2 mailbox after recovery


Single Mailbox and a Single item in a Mailbox recovery
Sometimes it happens, when you need to recover a single Mailbox, or even a single item in a Mailbox. For this, we make an appropriate scenario that is, start by deleting the first email from user2’s mailbox, as shown by figure given below:
    Figure 14 : Deleting emails from user2 mailbox

All steps of the recovery process are same as full recovery, so I will start with the point where we are asked to specify the recovery options. The actual database is still operational and mounted this time. So, we do not want to restore to the original location. You can choose the “Another location”, and proceed normally with the recovery process.Specify Recovery Options "Another Location".

    Figure 15 : Specify Recovery Options "Another Location"

Same as above, run the eseutil/mh command and newly recovered database will show it to be in a dirty shutdown state. As before simply mounting the database will not work as it needs to be brought into a “Clean Shutdown” state before it can be used as a Mailbox recovery database. This is notified by the warning which Exchange returns when you try to create the recovery database using the PowerShell command:New-MailboxDatabase recdb -Recovery:$true -EdbFilePath “c:\recover\Mailbox Database.edb” –LogFolderPath c:\recover –Server MBSrv-1

Note: Recovery databases cannot be created using Exchange Management Console.

   Figure 16 : Creating the recovery database

By simply running the below command, the database is brought to a clean shutdown state:
eseutil /r e00 /i /dc:\recover

This will perform a soft recovery of the database, and prepare it for mounting:



    Figure 17 : Bringing the database to a "Clean Shutdown" state

Running eseutil /mh “Mailbox Database.edb” will reveal that the database is now in a “Clean Shutdown” state, and ready to be mounted:
   Figure 18 : Checking the database state after eseutil /R

Using the “Mount-Database recdb” Powershell command, It is now safe to mount the database (“recdb” is a name of my recovery database – you can adjust it in your environment), To recover the user2’s Mailbox, run the following command :Restore-Mailbox user2 –RecoveryDatabase recdb

It is too easy an example of the Restore-Mailbox command that simply restores all the data for User2’s mailbox from the “recdb” database:


    Figure 19 : Restoring user2 mailbox

The first email was recovered, as you can see in figure 20. Remember that, this command can only use a disconnected mailbox as a data source, and a connected mailbox as a data target.


In this case I’ve restored Use2’s entire mailbox, there are a host of command line switches that you can use to limit the scope of the data you are recovering, and retrieve specific items.

    Figure 20 : Recovered emails

Limitations :

By using this plug-in, you can only perform VSS-based backups; stm files backups are not supported. Streaming backups weren’t supported in both Exchange 2007 and 2010, so this is a drawback.
  • By using Windows Server Backup, you cannot backup Exchange remotely; it must run locally on the Exchange 2010 mailbox server.
  •  Directly, does not support backup to a tape, so if you want to backup to tape, you will need to backup to a disk and then move the disk to tape.

Backup Recovery is a complex procedure, manual procedures sometimes don't match up the efficiency and ease provided by the automated third party tools.So its recommended by several administrators, Exchange Backup Recovery Tools suits users demand the most.

   


0 comments:

Post a Comment

Post a reply