- Full and Copy
The backup process is quite straight forward with Server 2003's NTBackup:
- Launch NTBackup by typing NTBackup in the the Run box
- Select the 'Advanced Mode' link
- Select the 'Backup' tab
- Select Microsoft Exchange Server and drill down to the storage group needed to back up
- Define a suitable backup location
- Click the Start Backup button
- As this will be a Full backup, select the 'Replace the data on the media with this backup'
- Click the 'Start Backup' button
- Now dismount the database you just backed up using the console
- Now delete the database in Windows Explorer C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group.
- Delete the .edb file
- Open NTBackup as you did above but this time select the 'Restore and Manage Media' tab
- Select the appropriate backup
- Click Start Restore
- Define a temporary location for log and patch files
- Select Last restore set
- Select Mount Database After Restore. Click OK.
- 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)
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
- Login as a valid Exchange recipient and make sure you have email in your Inbox.
- Using the methods shown above, backup your mailbox server
- Now, login as the user in step 1. and delete an email message (permanently using the shift key)
- 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
[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.
- 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
- Now restore the database using NTBackup
- We now need to mount the restore Mailbox Database using the Mount-Database cmdlet: [PS] Mount-Database –Identity “SRV161\Recovery Storage Group\DB1”
- 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”