Friday, 26 November 2010

BackUp of Exchange 2007 SP1 on Server 2003

The main backup types considered here are
  • Full and Copy
  • Differential
  • Incremental
Here are just a few notes...

    The backup process is quite straight forward with Server 2003's NTBackup:
    1. Launch NTBackup by typing NTBackup in the the Run box
    2. Select the 'Advanced Mode' link
    3. Select the 'Backup' tab
    4. Select Microsoft Exchange Server and drill down to the storage group needed to back up
    5. Define a suitable backup location
    6. Click the Start Backup button
    7. As this will be a Full backup, select the 'Replace the data on the media with this backup'
    8. Click the 'Start Backup' button
    To simulate a corrupt database
    1. Now dismount the database you just backed up using the console
    2. Now delete the database in Windows Explorer C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group. 
    3. Delete the .edb file
    4. Open NTBackup as you did above but this time select the 'Restore and Manage Media' tab
    5. Select the appropriate backup
    6. Click Start Restore
    7. Define a temporary location for log and patch files
    8. Select Last restore set
    9. Select Mount Database After Restore. Click OK.
    10. Check out the storage group in Windows Explorer and you should see the database is back (and you should still have access to your email)
    Recovery Storage Groups

    Its possible we may need to restore a particular mail message or an entire mailbox. You can retrieve deleted messages using outlook but if you permanently delete the message (hold the shift key down when you delete the message) or you go beyond the 14 day retention limit you would need to restore from backup. If you delete a mailbox it is kept in the database for 30 days, but if you go over this you will need to restore the mailbox from backup. The problem is that when you restore from backup, you will restore all the mailboxes not just the mailbox of interest.

    I will show you how to create and use a Recovery Storage Group using Powershell:

    Create a Recovery Storage Group
    1. Login as a valid Exchange recipient and make sure you have email in your Inbox.
    2. Using the methods shown above, backup your mailbox server
    3. Now, login as the user in step 1. and delete an email message (permanently using the shift key)
    4. Now create a Recovery Storage Group in the Powershell: [PS] New-StorageGroup –Server SRV161 –LogFolderPath “C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\RSG" –Name “Recovery Storage Group” –SystemFolderPath “C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\RSG” –Recovery
    You can determine if the RSG has been built by using the Get-StorageGroup cmdlet (observe the 'Recovery' attribute)

    In the next three steps we create a new mailbox database in the recovery storage group, allow it to be overwritten and finally overwrite it by restoring the backed up database. 

    Add a Recovery Database

    1. [PS] New-MailboxDatabase –MailboxDatabaseToRecover “DB1” –StorageGroup “SRV161\Recovery Storage Group” –EDBFilePath “C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\RSG\DB1.edb”  The -MailboxDatabaseToRecover references the production database that has been backedup and contains our deleted email.
    2. With the Mailbox Database created in the Recovery Storage Group we now need to configure it to allow overwrites by running the Set-MailboxDatabase cmdlet with the –AllowRestore parameter. [PS]Set-MailboxDatabase -Identity "SRV161\Recovery Storage Group\DB1" -AllowFileRestore $true
    3. Now restore the database using NTBackup
    4. We now need to mount the restore Mailbox Database using the Mount-Database cmdlet:           [PS] Mount-Database –Identity “SRV161\Recovery Storage Group\DB1” 
    5. Now we want to merge the mailbox data of an existing user in the recovery database to the production mailbox database: [PS]Restore-Mailbox –Identity paulwest -RSGDatabase “servername\RSG name\database name” 

    If you need to recover mailbox data for all users in the RSG, you would need to use the following command:
    [PS]Get-MailboxStatistics  -Database “Recovery Storage Group\Mailbox Database” | Restore-Mailbox

     You should now remove the recovery database and recovery storage group using the following cmdlets:

    [PS]Remove-MailboxDatabase –Identity “SRV161\Recovery Storage Group\DB1” 

    [PS]Remove-StorageGroup –Identity “SRV161\Recovery Storage Group”


    1. All the three backup methods are very useful for exchange 2007 on server 2003.These three methods are very well explained and easy to understand.I think that incremental approach is best to use.Very well done.

    2. Replies
      1. Checkout one of the best Exchange Server EDB Recovery software, which i ever used :