Repairing an export job

After an export job has completed, you can run the Microsoft Azure Import/Export Tool on-premises to:

  1. Download any files that the Azure Import/Export service was unable to export.

  2. Validate that the files on the drive were correctly exported.

You must have connectivity to Azure Storage to use this functionality.

The command for repairing an import job is RepairExport.

RepairExport parameters

The following parameters can be specified with RepairExport:

Parameter Description
/r:<RepairFile> Required. Path to the repair file, which tracks the progress of the repair, and allows you to resume an interrupted repair. Each drive must have one and only one repair file. When you start a repair for a given drive, you will pass in the path to a repair file which does not yet exist. To resume an interrupted repair, you should pass in the name of an existing repair file. The repair file corresponding to the target drive must always be specified.
/logdir:<LogDirectory> Optional. The log directory. Verbose log files will be written to this directory. If no log directory is specified, the current directory will be used as the log directory.
/d:<TargetDirectory> Required. The directory to validate and repair. This is usually the root directory of the export drive, but could also be a network file share containing a copy of the exported files.
/bk:<BitLockerKey> Optional. You should specify the BitLocker key if you want the tool to unlock an encrypted where the exported files are stored.
/sn:<StorageAccountName> Required. The name of the storage account for the export job.
/sk:<StorageAccountKey> Required if and only if a container SAS is not specified. The account key for the storage account for the export job.
/csas:<ContainerSas> Required if and only if the storage account key is not specified. The container SAS for accessing the blobs associated with the export job.
/CopyLogFile:<DriveCopyLogFile> Required. The path to the drive copy log file. The file is generated by the Windows Azure Import/Export service and can be downloaded from the blob storage associated with the job. The copy log file contains information about failed blobs or files which are to be repaired.
/ManifestFile:<DriveManifestFile> Optional. The path to the export drive's manifest file. This file is generated by the Windows Azure Import/Export service and stored on the export drive, and optionally in a blob in the storage account associated with the job.

The content of the files on the export drive will be verified with the MD5 hashes contained in this file. Any files that are determined to be corrupted will be downloaded and rewritten to the target directories.

Using RepairExport mode to correct failed exports

You can use the Azure Import/Export Tool to download files that failed to export. The copy log file will contain a list of files that failed to export.

The causes of export failures include the following possibilities:

  • Damaged drives

  • The storage account key changed during the transfer process

To run the tool in RepairExport mode, you first need to connect the drive containing the exported files to your computer. Next, run the Azure Import/Export Tool, specifying the path to that drive with the /d parameter. You also need to specify the path to the drive's copy log file that you downloaded. The following command line example below runs the tool to repair any files that failed to export:

WAImportExport.exe RepairExport /r:C:\WAImportExport\9WM35C3U.rep /d:G:\ /sn:bobmediaaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /CopyLogFile:C:\WAImportExport\9WM35C3U.log  

The following is an example of a copy log file that shows that one block in the blob failed to export:

<?xml version="1.0" encoding="utf-8"?>  
<DriveLog>  
  <DriveId>9WM35C2V</DriveId>  
  <Blob Status="CompletedWithErrors">  
    <BlobPath>pictures/wild/desert.jpg</BlobPath>  
    <FilePath>\pictures\wild\desert.jpg</FilePath>  
    <LastModified>2012-09-18T23:47:08Z</LastModified>  
    <Length>163840</Length>  
    <BlockList>  
      <Block Offset="65536" Length="65536" Id="AQAAAA==" Status="Failed" />  
    </BlockList>  
  </Blob>  
  <Status>CompletedWithErrors</Status>  
</DriveLog>  

The copy log file indicates that a failure occurred while the Windows Azure Import/Export service was downloading one of the blob's blocks to the file on the export drive. The other components of the file downloaded successfully, and the file length was correctly set. In this case, the tool will open the file on the drive, download the block from the storage account, and write it to the file range starting from offset 65536 with length 65536.

Using RepairExport to validate drive contents

You can also use Azure Import/Export with the RepairExport option to validate the contents on the drive are correct. The manifest file on each export drive contains MD5s for the contents of the drive.

The Azure Import/Export service can also save the manifest files to a storage account during the export process. The location of the manifest files is available via the Get Job operation when the job has completed. See Import/Export service Manifest File Format for more information about the format of a drive manifest file.

The following example shows how to run the Azure Import/Export Tool with the /ManifestFile and /CopyLogFile parameters:

WAImportExport.exe RepairExport /r:C:\WAImportExport\9WM35C3U.rep /d:G:\ /sn:bobmediaaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /CopyLogFile:C:\WAImportExport\9WM35C3U.log /ManifestFile:G:\9WM35C3U.manifest  

The following is an example of a manifest file:

<?xml version="1.0" encoding="utf-8"?>  
<DriveManifest Version="2011-10-01">  
  <Drive>  
    <DriveId>9WM35C3U</DriveId>  
    <ClientCreator>Windows Azure Import/Export service</ClientCreator>  
    <BlobList>
      <Blob>  
        <BlobPath>pictures/city/redmond.jpg</BlobPath>  
        <FilePath>\pictures\city\redmond.jpg</FilePath>  
        <Length>15360</Length>  
        <PageRangeList>  
          <PageRange Offset="0" Length="3584" Hash="72FC55ED9AFDD40A0C8D5C4193208416" />  
          <PageRange Offset="3584" Length="3584" Hash="68B28A561B73D1DA769D4C24AA427DB8" />  
          <PageRange Offset="7168" Length="512" Hash="F521DF2F50C46BC5F9EA9FB787A23EED" />  
        </PageRangeList>  
        <PropertiesPath Hash="E72A22EA959566066AD89E3B49020C0A">\pictures\city\redmond.jpg.properties</PropertiesPath>  
      </Blob>  
      <Blob>  
        <BlobPath>pictures/wild/canyon.jpg</BlobPath>  
        <FilePath>\pictures\wild\canyon.jpg</FilePath>  
        <Length>10884</Length>  
        <BlockList>  
          <Block Offset="0" Length="2721" Id="AAAAAA==" Hash="263DC9C4B99C2177769C5EBE04787037" />  
          <Block Offset="2721" Length="2721" Id="AQAAAA==" Hash="0C52BAE2CC20EFEC15CC1E3045517AA6" />  
          <Block Offset="5442" Length="2721" Id="AgAAAA==" Hash="73D1CB62CB426230C34C9F57B7148F10" />  
          <Block Offset="8163" Length="2721" Id="AwAAAA==" Hash="11210E665C5F8E7E4F136D053B243E6A" />  
        </BlockList>  
        <PropertiesPath Hash="81D7F81B2C29F10D6E123D386C3A4D5A">\pictures\wild\canyon.jpg.properties</PropertiesPath>  
      </Blob> 
    </BlobList>  
 </Drive>  
</DriveManifest>  

After finishing the repair process, the tool will read through each file referenced in the manifest file and verify the file's integrity with the MD5 hashes. For the manifest above, it will go through the following components.

G:\pictures\city\redmond.jpg, offset 0, length 3584  

G:\pictures\city\redmond.jpg, offset 3584, length 3584  

G:\pictures\city\redmond.jpg, offset 7168, length 3584  

G:\pictures\city\redmond.jpg.properties  

G:\pictures\wild\canyon.jpg, offset 0, length 2721  

G:\pictures\wild\canyon.jpg, offset 2721, length 2721  

G:\pictures\wild\canyon.jpg, offset 5442, length 2721  

G:\pictures\wild\canyon.jpg, offset 8163, length 2721  

G:\pictures\wild\canyon.jpg.properties  

Any component failing the verification will be downloaded by the tool and rewritten to the same file on the drive.

Next steps