Repairing an import job
The Microsoft Azure Import/Export service may fail to copy some of your files or parts of a file to the Windows Azure Blob service. Some reasons for failures include:
The storage account key changed while the file was being transferred.
You can run the Microsoft Azure Import/Export Tool with the import job's copy log files. The tool uploads the missing files, or parts of a file, to your Windows Azure storage account to complete the import job.
The following parameters can be specified with RepairImport:
|/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, pass in the path to a repair file, which doesn't yet exist. To resume an interrupted repair, you should pass in the name of an existing repair file. Always specify the repair file corresponding to the target drive.|
|/logdir:<LogDirectory>||Optional. The log directory. Verbose log files are written to this directory. If no log directory is specified, the current directory is used as the log directory.|
|/d:<TargetDirectories>||Required. One or more semicolon-separated directories that contain the original files that were imported. The import drive may also be used, but isn't required if alternate locations of original files are available.|
|/bk:<BitLockerKey>||Optional. Specify the BitLocker key if you want the tool to unlock an encrypted drive where the original files are available.|
|/sn:<StorageAccountName>||Required. The name of the storage account for the import job.|
|/sk:<StorageAccountKey>||Required if and only if a container SAS isn't specified. The account key for the storage account for the import job.|
|/csas:<ContainerSas>||Required if and only if the storage account key isn't specified. The container SAS for accessing the blobs associated with the import job.|
|/CopyLogFile:<DriveCopyLogFile>||Required. Path to the drive copy log file (either verbose log or error log). 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.|
|/PathMapFile:<DrivePathMapFile>||Optional. Path to a text file used to resolve ambiguities if you have multiple files with the same name that you were importing in the same job. The first time the tool is run, it can populate this file with all of the ambiguous names. Later runs of the tool use this file to resolve the ambiguities.|
Using the RepairImport command
To repair import data by streaming the data over the network, you must specify the directories that contain the original files you were importing using the
/d parameter. Also specify the copy log file that you downloaded from your storage account. A typical command line to repair an import job with partial failures looks like:
WAImportExport.exe RepairImport /r:C:\WAImportExport\9WM35C2V.rep /d:C:\Users\bob\Pictures;X:\BobBackup\photos /sn:bobmediaaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /CopyLogFile:C:\WAImportExport\9WM35C2V.log
In the following example of a copy log file, one 64-K piece of a file was corrupted on the drive that was shipped for the import job. Since this failure is the only one indicated, the rest of the blobs in the job were successfully imported.
<?xml version="1.0" encoding="utf-8"?> <DriveLog> <DriveId>9WM35C2V</DriveId> <Blob Status="CompletedWithErrors"> <BlobPath>pictures/animals/koala.jpg</BlobPath> <FilePath>\animals\koala.jpg</FilePath> <Length>163840</Length> <ImportDisposition Status="Overwritten">overwrite</ImportDisposition> <PageRangeList> <PageRange Offset="65536" Length="65536" Hash="AA2585F6F6FD01C4AD4256E018240CD4" Status="Corrupted" /> </PageRangeList> </Blob> <Status>CompletedWithErrors</Status> </DriveLog>
When this copy log is passed to the Azure Import/Export Tool, the tool tries to finish the import for this file by copying the missing contents across the network. Following the example above, the tool looks for the original file
\animals\koala.jpg within the two directories
X:\BobBackup\photos. If the file
C:\Users\bob\Pictures\animals\koala.jpg exists, the Azure Import/Export Tool copies the missing range of data to the corresponding blob
Resolving conflicts when using RepairImport
In some situations, the tool may not be able to find or open the necessary file for one of the following reasons: the file couldn't be found, the file isn't accessible, the file name is ambiguous, or the content of the file is no longer correct.
An ambiguous error could occur if the tool is trying to locate
\animals\koala.jpg and there's a file with that name under both
X:\BobBackup\photos. That is, both
X:\BobBackup\photos\animals\koala.jpg exist on the import job drives.
/PathMapFile option allows you to resolve these errors. You can specify the name of the file, which contains the list of files that the tool couldn't correctly identify. The following command-line example populates
WAImportExport.exe RepairImport /r:C:\WAImportExport\9WM35C2V.rep /d:C:\Users\bob\Pictures;X:\BobBackup\photos /sn:bobmediaaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /CopyLogFile:C:\WAImportExport\9WM35C2V.log /PathMapFile:C:\WAImportExport\9WM35C2V_pathmap.txt
The tool will then write the problematic file paths to
9WM35C2V_pathmap.txt, one on each line. For instance, the file may contain the following entries after running the command:
For each file in the list, you should attempt to locate and open the file to ensure it's available to the tool. If you wish to tell the tool explicitly where to find a file, modify the path map file and add the path to each file on the same line, separated by a tab character:
\animals\koala.jpg C:\Users\bob\Pictures\animals\koala.jpg \animals\kangaroo.jpg X:\BobBackup\photos\animals\kangaroo.jpg
After making the necessary files available to the tool, or updating the path map file, you can rerun the tool to complete the import process.