Restore and Recovery Operations

Topic Last Modified: 2009-07-24

As with backup operations, software developers should follow the procedures outlined in the Volume Shadow Copy Service SDK Overview and Reference Guide to restore and recover Microsoft Exchange Server 2007 database and storage groups.

Exchange 2007 Store Writer includes increased flexibility for restoring storage groups and databases. In versions of Exchange earlier than Exchange 2007, shadow copy restores are supported only if restores are targeted to the same file paths. In Exchange 2007, shadow copy backups taken with any of the Exchange Writers, the Store Writer or the Replication Writer, can be restored with Store Writer and targeted to one of the following:

  • The original storage group, regarless of whether the database or transaction log file path configurations has been modified.
  • The recovery storage group.
  • Any production storage group without requiring the storage group or database display names to match the backup set.
  • Non-Exchange directory paths.

Exchange 2007 does not rely on database mount to replay transaction log files into the restored database. Instead Store Writer offers backup applications to request recovery to be run as part of OnPostRestore() by the Exchange Store Writer itself.

The Exchange 2007 Store Writer also improves pre-restore and post-restore verification checking, and changes the way that applications designate target storage group and database locations.

The Store Writer calls the GetRestoreOptions() method to obtain the settings made by the application by using the SetRestoreOptions() method. The application calls the SetRestoreOptions() method when the target location of the restore is different than the location where the backup was originally created. The backup application can also set the restore file paths by using the AddNewTarget() method. If the application does not specify a different restore location by using the SetRestoreOptions() or AddNewTarget() methods, the writer restores the files to the locations specified in the backup set. If the file paths and GUIDs are not the same as those found in the Active Directory directory service for the target storage group, the writer will return an error.

When the backup application restores information to the original location of the storage group, the log files must be restored to the directory path specified in Active Directory for that storage group. If the application restores a storage group or individual databases to a different location, the log files must be restored to a folder named _restoredLogs that is located inside the storage group log file directory.

When restoring to a server, storage group, or database that is different from where the backup originated, the backup application must make sure that the storage group and database directory paths provided to VSS match those in Active Directory. Information about existing databases and storage groups can also be obtained by using the new get-StorageGroup, get-MailboxDatabase, and get-PublicFolderDatabase commands.

When using the Exchange Server 2007 Replication Writer for backup, the application must use the Store Writer to restore the database and log files. The application uses the SetSelectedForRestoreEx() to set the writer to use when restoring the data.

In addition, the backup application can use the SetAdditionalRestore() API to instruct the Exchange Server 2007 writer to replay the log files after restoring the database and log files. When restoring from multiple backup sets, the application must call SetAdditionalRestore() for each restore operation except for the last one. Calling SetAddtionalRestore() prevents the Exchange Server 2007 writer from replaying the logs immediately after the restore. When performing the last restore, the application should not call SetAdditionalRestore(), so that the computer that is running Exchange 2007 will replay all the log files after that last file restore completes.