- Overview
- How does the Auto Restore XML File Work?
- Locating the Source Image File Folder
- Locating the Correct Source Image File
- Locating the Restore Destination Disk
Overview
The auto restore XML enables rapid golden image deployment with the Macrium Deployment Kit by reducing the number of manual steps required on the target endpoint to initiate a deployment. This article contains more information about creating an auto restore XML file.
How does the Auto Restore XML File Work?
Once the rescue media has been booted, local drives are scanned in alphabetical order for a 'macrium_restore.xml' auto restore XML file in the root of the drive; this can be any local drive, including USB flash drives and optical media. Macrium Reflect will use the first auto restore XML file that is found.
The auto restore XML file contains the relevant instructions to locate the golden image file and then restore the golden image to the target disk specified in the 'Auto Restore' dialog.
It is imperative that the correct image file is restored to the intended disk. To ensure that there is no accidental data loss after restoring, Macrium Reflect will, by default, use unique disk identifiers and sector offsets to match the source and target of the restore.
Locating the Source Image File Folder
The default behaviour is to read the image file specified in the <file_name> xml node. However, It's possible that Windows PE has assigned different drive letters to local drives; in this case, the following procedure is followed.
-
All local drives are scanned for a "marker" file that is created when the restore definition is saved. This marker file has the following file name format: 'Macrium_restore_{GUID}.txt', where the GUID (globally unique identifier) is retrieved from the '<search node>' in the auto restore XML.
<search guid="{0D6B46C4-A5ED-4578-A9C0-5539B0AB94A0}">Y</search>
<file_name>D:\backups\auto_restore\4E855CB463979BC9-01-01.mrimgx</file_name>
If the marker file isn't found in the path specified in the <file_name> XML node, then all local drives are searched for the marker file in the same subfolder. If the marker file is found, then that folder will be searched for the image file to restore.
- If no Marker file is found or is not specified in the XML, then all local drives are scanned (from A to Z) to locate any images in the folder specified by the '<file_name>' XML node that contain images to restore.
This process is not necessary when the image file is located on a network share. The network share path is absolute and will not change when booting the rescue media.
Locating the Correct Source Image File
The default behavior is to read the specified image file in the folder in the '<image_file>' XML node. However, if 'Restore the latest matching image in the same folder' was selected when the auto restore XML was created, then the following procedure is followed:
The XML attribute find_recent="Y" is added to the <file_name> XML node, similar to the example below:
<file_name find_recent="Y">D:\backups\auto_restore\4E855CB463979BC9-01-01.mrimgx</file_name>
All matching backup sets are loaded in the image file folder, and the most recent backup date is selected and used for the restore. A matching backup set has the same disk and partitions that were specified in the auto restore XML:
<restore_definition>
<properties>
<source_disk id="3A177438-02D6-4DB6-9FCC-184F81DEE52A">1</source_disk>
</properties>
<operation id="1">
<type>copy</type>
<copy>
<source>
<partition start_sector="2048" end_sector="616447">1</partition>
</source>
</copy>
</operation>
</restore_definition>
A matching image file contains the same disk identifier and partition start and end sectors as well as partition numbers. In this example: Disk identifier 3A177438-02D6-4DB6-9FCC-184F81DEE52A and partition number 1 with start sector 2048 and end sector 616447.
Locating the Restore Destination Disk
The default behaviour is to select the target disk by matching the unique disk identifier specified in the <target_disk> XML node. However, if 'Match target disk number if unique id not found' was selected when the auto restore XML was made, then the following procedure is followed:
XML attribute number_fallback="Y" is added to the <target_disk> XML node:
<target_disk id="3A177438-02D6-4DB6-9FCC-184F81DEE52A" number_fallback="Y">1</target_disk>
The restore target disk is matched on disk number if a disk cannot be matched using the unique identifier.
This option should be used with caution. Windows PE/RE may load disks in a different sequence from Windows. This can potentially cause the incorrect disk to be restored to.