Writer Metadata Document Life Cycle
In response to an Identify event, each writer present on the system constructs its own Writer Metadata Document using IVssCreateWriterMetadata. An Identify event is typically generated by a requester calling IVssBackupComponents::GatherWriterMetadata.
When creating a Writer Metadata Document, either through the IVssCreateWriterMetadata interface or through writer initialization (CVssWriter::Initialize), a writer must explicitly specify the following:
- Restore method
- Writer name
- Writer class ID
- Data usage (see VSS_USAGE_TYPE)
- Date source type (see VSS_SOURCE_TYPE)
In addition, it may also specify the following:
- Components (which may or may not contain file sets)
- Add alternate mappings
- Exclude file lists
An overview of Writer Metadata Document creation is found in Writer Actions during Backup Initialization.
Requesters typically make use of one of two methods to obtain access to writer metadata:
- During most backup operations, a requester uses IVssBackupComponents::GetWriterMetadata to obtain an instance of the IVssExamineWriterMetadata interface to allow access to the metadata of a currently executing writer.
- For restore operations, or backups using imported shadow copies (see Importing Transportable Shadow Copied Volumes for more information on importing shadow copies), a requester retrieves an XML document containing the metadata and uses CreateVssExamineWriterMetadata to obtain an IVssExamineWriterMetadata interface, which it uses to read the restore metadata.
Writer Metadata Documents enable the requester performing a backup to learn about currently executing writers during the discovery phase of a backup.
For those writers chosen to participate in a backup, a requester imports much, but not all, of the information in the Writer Metadata Document into its own Backup Components Document during the discovery phase of a backup.
However, only Writer Metadata Documents and not the Backup Components Document contain the file and path specifications.
For more information on how the discovery phase of a backup operation is conducted, see Overview of the Backup Discovery Phase.
In addition, only explicitly included components have their information stored in the Backup Components Document during a backup operation. Information on implicitly included components is not included in the Backup Components Document during a backup operation, and must be interpolated using information about the explicitly included components and the available Writer Metadata Documents.
Implicitly included components may still be selectable for restore and may need to be explicitly included in the Backup Components Document at restore time. In this case, just as adding a component during a backup operation required access to the component's writer's Writer Metadata Document (then retrieved from the writer), a requester will require access to a copy of that writer's Writer Metadata Documents stored at backup time.
Therefore, the only way to obtain all the information about all the files and components involved in a backup or restore is to have each Writer Metadata Document for each writer participating in a backup stored along with the Backup Components Document. (For more information, see Overview of Actual File Restoration.)