Setting VSS Restore Targets

The IVssComponent interface enables a writer to fine-tune exactly how files are restored on a component-by-component basis.

Because it is possible that the system configuration during restore is something other than that anticipated during backup, the restore target mechanism is provided.

It allows writers to call IVssComponent::SetRestoreTarget to change how those components that are explicitly included in the Backup Components Document are restored. This also changes the restoration mechanism used on those components that are implicitly included.

File restoration that takes place during a system reboot (under the VSS_RESTOREMETHOD_ENUM enumeration values VSS_RME_RESTORE_AT_REBOOT and VSS_RME_RESTORE_AT_REBOOT_IF_CANNOT_REPLACE) cannot be affected by restore targets because there are no running VSS services when MoveFileEx copies files to their final location.

Similarly, VSS_RME_CUSTOM restores may or may not be affected, because each custom restore is specific to a given writer and can choose to respect or ignore restore targets.

Requesters and writers can use IVssComponent::GetRestoreTarget to check the restore target of a component set.

IVssComponent supports the following restore targets, which can be set on a component set by component set basis:

  • VSS_RT_ORIGINAL. The restore method specified by the VSS_RESTOREMETHOD_ENUM enumeration will be respected.
  • VSS_RT_ALTERNATE. The files are restored to a location determined from an existing alternate location mapping. If an alternate location mapping matching a path in a component set subcomponent exists, restore to the alternate location if possible; otherwise, return an error.