使用 Azure 导入/导出服务将数据导入到 Azure 文件Use Azure Import/Export service to import data to Azure Files

本文提供了有关如何使用 Azure 导入/导出服务安全地将大量数据导入到 Azure 文件的分步说明。This article provides step-by-step instructions on how to use the Azure Import/Export service to securely import large amounts of data into Azure Files. 若要导入数据,此服务要求你将包含数据的受支持磁盘驱动器寄送到某个 Azure 数据中心。To import data, the service requires you to ship supported disk drives containing your data to an Azure datacenter.

导入/导出服务仅支持将 Azure 文件导入到 Azure 存储。The Import/Export service supports only import of Azure Files into Azure Storage. 不支持导出 Azure 文件。Exporting Azure Files is not supported.

先决条件Prerequisites

在创建导入作业来将数据传输到 Azure 文件之前,请仔细查看并完成以下先决条件列表。Before you create an import job to transfer data into Azure Files, carefully review and complete the following list of prerequisites. 必须具备以下条件:You must:

步骤 1:准备驱动器Step 1: Prepare the drives

此步骤生成一个日志文件。This step generates a journal file. 日志文件存储着驱动器序列号、加密密钥和存储帐户详细信息等基本信息。The journal file stores basic information such as drive serial number, encryption key, and storage account details.

请执行以下步骤来准备驱动器。Perform the following steps to prepare the drives.

  1. 通过 SATA 连接器将磁盘驱动器连接到 Windows 系统。Connect our disk drives to the Windows system via SATA connectors.

  2. 在每个驱动器上创建一个 NTFS 卷。Create a single NTFS volume on each drive. 为卷分配驱动器号。Assign a drive letter to the volume. 不要使用装入点。Do not use mountpoints.

  3. 修改工具所在的根文件夹中的 dataset.csv 文件。Modify the dataset.csv file in the root folder where the tool resides. 根据是要导入文件还是文件夹还是同时导入两者,在 dataset.csv 文件中添加类似于以下示例的条目。Depending on whether you want to import a file or folder or both, add entries in the dataset.csv file similar to the following examples.

    • 导入文件:在以下示例中,要复制的数据位于 F: 驱动器中。To import a file: In the following example, the data to copy resides in the F: drive. 文件 MyFile1.txt 将被复制到根目录 MyAzureFileshare1 中。Your file MyFile1.txt is copied to the root of the MyAzureFileshare1. 如果 MyAzureFileshare1 不存在,则会在 Azure 存储帐户中创建该目录。If the MyAzureFileshare1 does not exist, it is created in the Azure Storage account. 文件夹结构保持不变。Folder structure is maintained.

          BasePath,DstItemPathOrPrefix,ItemType,Disposition,MetadataFile,PropertiesFile
          "F:\MyFolder1\MyFile1.txt","MyAzureFileshare1/MyFile1.txt",file,rename,"None",None
      
      
    • 导入文件夹MyFolder2 下的所有文件和文件夹将以递归方式复制到该文件共享。To import a folder: All files and folders under MyFolder2 are recursively copied to fileshare. 文件夹结构保持不变。Folder structure is maintained.

          "F:\MyFolder2\","MyAzureFileshare1/",file,rename,"None",None
      
      

      可以在同一文件中创建与导入的文件夹或文件对应的多个条目。Multiple entries can be made in the same file corresponding to folders or files that are imported.

          "F:\MyFolder1\MyFile1.txt","MyAzureFileshare1/MyFile1.txt",file,rename,"None",None
          "F:\MyFolder2\","MyAzureFileshare1/",file,rename,"None",None
      
      

      详细了解如何准备数据集 CSV 文件Learn more about preparing the dataset CSV file.

  4. 修改工具所在的根文件夹中的 driveset.csv 文件。Modify the driveset.csv file in the root folder where the tool resides. driveset.csv 文件中添加类似于以下示例的条目。Add entries in the driveset.csv file similar to the following examples. 此驱动器集文件包含磁盘列表和对应的驱动器号,因此,工具可以正确地选取要准备的磁盘列表。The driveset file has the list of disks and corresponding drive letters so that the tool can correctly pick the list of disks to be prepared.

    此示例假定将附加两个磁盘并创建基本 NTFS 卷 G:\ 和 H:\。This example assumes that two disks are attached and basic NTFS volumes G:\ and H:\ are created. H:\ 未加密,而 G: 已加密。H:\is not encrypted while G: is already encrypted. 该工具仅会对承载着 H:\(不会对承载着 G:))的磁盘进行格式化和加密。The tool formats and encrypts the disk that hosts H:\ only (and not G:).

    • 对于未加密的磁盘:请指定 Encrypt 以在磁盘上启用 BitLocker 加密。For a disk that is not encrypted: Specify Encrypt to enable BitLocker encryption on the disk.

      DriveLetter,FormatOption,SilentOrPromptOnFormat,Encryption,ExistingBitLockerKey
      H,Format,SilentMode,Encrypt,
      
    • 对于已加密的磁盘:请指定 AlreadyEncrypted 并提供 BitLocker 密钥。For a disk that is already encrypted: Specify AlreadyEncrypted and supply the BitLocker key.

      DriveLetter,FormatOption,SilentOrPromptOnFormat,Encryption,ExistingBitLockerKey
      G,AlreadyFormatted,SilentMode,AlreadyEncrypted,060456-014509-132033-080300-252615-584177-672089-411631
      

      可以在同一文件中创建与多个驱动器对应的多个条目。Multiple entries can be made in the same file corresponding to multiple drives. 详细了解如何准备驱动器集 CSV 文件Learn more about preparing the driveset CSV file.

  5. 使用 PrepImport 选项将数据复制到磁盘驱动器并做好准备。Use the PrepImport option to copy and prepare data to the disk drive. 为了使第一个复制会话通过新的复制会话复制目录和/或文件,请运行以下命令:For the first copy session to copy directories and/or files with a new copy session, run the following command:

    .\WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> [/logdir:<LogDirectory>] [/sk:<StorageAccountKey>] [/silentmode] [/InitialDriveSet:<driveset.csv>]/DataSet:<dataset.csv>
    

    下面显示了一个导入示例。An import example is shown below.

    .\WAImportExport.exe PrepImport /j:JournalTest.jrn /id:session#1  /sk:************* /InitialDriveSet:driveset.csv /DataSet:dataset.csv /logdir:C:\logs
    
  6. 每次运行该命令行时,都会使用通过 /j: 参数提供名称创建一个日志文件。A journal file with name you provided with /j: parameter, is created for every run of the command line. 你准备的每个驱动器都有一个在创建导入作业时必须上传的日志文件。Each drive you prepare has a journal file that must be uploaded when you create the import job. 不会处理没有日志文件的驱动器。Drives without journal files are not processed.

    重要

    • 完成磁盘准备工作后,请不要改磁盘驱动器上的数据,也不要修改日志文件。Do not modify the data on the disk drives or the journal file after completing disk preparation.

有关更多示例,请转到日志文件示例For additional samples, go to Samples for journal files.

步骤 2:创建导入作业Step 2: Create an import job

在 Azure 门户中执行以下步骤来创建导入作业。Perform the following steps to create an import job in the Azure portal.

  1. 登录到 https://portal.azure.cn/Log on to https://portal.azure.cn/.

  2. 转到“所有服务”>“存储”>“导入/导出作业”。Go to All services > Storage > Import/export jobs.

    转到“导入/导出”

  3. 单击“创建导入/导出作业”。Click Create Import/export Job.

    单击导入/导出作业

  4. 在“基本信息”中:In Basics:

    • 选择“导入到 Azure”。Select Import into Azure.

    • 输入导入作业的描述性名称。Enter a descriptive name for the import job. 在作业进行过程中以及作业完成后,可以使用此名称来跟踪作业。Use this name to track your jobs while they are in progress and once they are completed.

      • 此名称只能包含小写字母、数字、连字符和下划线。This name may contain only lowercase letters, numbers, hyphens, and underscores.
      • 此名称必须以字母开头,并且不得包含空格。The name must start with a letter, and may not contain spaces.
    • 选择一个订阅。Select a subscription.

    • 选一个择资源组。Select a resource group.

      创建导入作业 - 步骤 1

  5. 在“作业详细信息”中:In Job details:

    • 上传你在前面的步骤 1:准备驱动器中创建的日志文件。Upload the journal files that you created during the preceding Step 1: Prepare the drives.

    • 选择要将数据导入到的存储帐户。Select the storage account that the data will be imported into.

    • 放置位置会根据选定存储帐户所属的区域自动进行填充。The dropoff location is automatically populated based on the region of the storage account selected.

      创建导入作业 - 步骤 2

  6. 在“回寄信息”中:In Return shipping info:

    • 从下拉列表中选择承运商。Select the carrier from the drop-down list.

    • 输入你已在该承运商那里创建的有效承运商帐户编号。Enter a valid carrier account number that you have created with that carrier. 当导入作业完成后,我们使用此帐户寄回驱动器。We use this account to ship the drives back to you once your import job is complete.

    • 提供完整、有效的联系人姓名、电话号码、电子邮件地址、街道地址、城市、邮政编码、省/自治区/直辖市和国家/地区。Provide a complete and valid contact name, phone, email, street address, city, zip, state/province and country/region.

      提示

      请提供组电子邮件,而非为单个用户指定电子邮件地址。Instead of specifying an email address for a single user, provide a group email. 这可确保即使管理员离开也会收到通知。This ensures that you receive notifications even if an admin leaves.

      创建导入作业 - 步骤 3

  7. 在“摘要”中:In the Summary:

    • 提供用来将磁盘寄回 Azure 的 Azure 数据中心送货地址。Provide the Azure datacenter shipping address for shipping disks back to Azure. 请确保寄送标签上标明了作业名称和完整地址。Ensure that the job name and the full address are mentioned on the shipping label.

    • 单击“确定”以完成导入作业创建。Click OK to complete import job creation.

      创建导入作业 - 步骤 4

步骤 3:将驱动器寄送到 Azure 数据中心Step 3: Ship the drives to the Azure datacenter

可以使用 EMS 将包裹寄送到 Azure 数据中心。EMS can be used to ship the package to Azure datacenter.

  • 提供 Azure 将用于寄回驱动器的有效 EMS 运营商帐号。Provide a valid EMS carrier account number that Azure will use to ship the drives back.

步骤 4:使用跟踪信息更新作业Step 4: Update the job with tracking information

寄送磁盘后,请返回到 Azure 门户中的“导入/导出” 页面。After shipping the disks, return to the Import/Export page on the Azure portal.

重要

如果在创建作业后的 2 周内未更新跟踪号,该作业会过期。If the tracking number is not updated within 2 weeks of creating the job, the job expires.

若要更新跟踪号,请执行以下步骤。To update the tracking number, perform the following steps.

  1. 选择并单击作业。Select and click the job.
  2. 单击“寄送驱动器后更新作业状态和跟踪信息” 。Click Update job status and tracking info once drives are shipped.
  3. 选中“标记为已寄送” 旁的复选框。Select the checkbox against Mark as shipped.
  4. 提供承运商信息 和跟踪号码 (例如 ID:000000000000000000;SN:00000000000000)。Provide the Carrier and Tracking number (e.g.ID:000000000000000000;SN:00000000000000).
    • 对于跟踪号码:For tracking numbers:
    • 如果通过快递寄送,请键入有效的快递单号码 + 设备序列号。If ship by courier, please type valid courier numbers + Device serial numbers.
    • 如果自己发运,请键入 ID 号 + 设备序列号。If ship by yourself, please type ID numbers + Device serial numbers.
  5. 在门户仪表板上跟踪作业进度。Track the job progress on the portal dashboard. 有关每个作业状态的说明,请转到查看作业状态For a description of each job state, go to View your job status.

步骤 5:验证数据上传到 AzureStep 5: Verify data upload to Azure

跟踪作业直至完成。Track the job to completion. 作业完成后,验证数据已上传到 Azure。Once the job is complete, verify that your data has uploaded to Azure. 仅在已确认上传成功后才删除本地数据。Delete the on-premises data only after you have verified that upload was successful.

日志文件示例Samples for journal files

若要 添加更多驱动器,请创建一个新的驱动器集文件并运行以下命令。To add more drives, create a new driveset file and run the command as below.

如果后续复制会话中的磁盘驱动器与 InitialDriveset .csv 文件中指定的不同,请指定一个新的驱动器集 .csv 文件并将其提供为参数 AdditionalDriveSet 的值。For subsequent copy sessions to the different disk drives than specified in InitialDriveset .csv file, specify a new driveset .csv file and provide it as a value to the parameter AdditionalDriveSet. 使用 同一日记文件 的名称并提供 新的会话 IDUse the same journal file name and provide a new session ID. AdditionalDriveset CSV 文件的格式与 InitialDriveSet 的格式相同。The format of AdditionalDriveset CSV file is same as InitialDriveSet format.

WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> /AdditionalDriveSet:<driveset.csv>

下面显示了一个导入示例。An import example is shown below.

WAImportExport.exe PrepImport /j:JournalTest.jrn /id:session#3  /AdditionalDriveSet:driveset-2.csv

若要向同一驱动器集添加更多数据,请为后续复制会话使用 PrepImport 命令来复制更多文件/目录。To add additional data to the same driveset, use the PrepImport command for subsequent copy sessions to copy additional files/directory.

在后续复制会话中将数据复制到 InitialDriveset.csv 文件中指定的同一组硬盘驱动器时,请指定 同一日志文件 名称并提供 新的会话 ID;不需要提供存储帐户密钥。For subsequent copy sessions to the same hard disk drives specified in InitialDriveset.csv file, specify the same journal file name and provide a new session ID; there is no need to provide the storage account key.

WAImportExport PrepImport /j:<JournalFile> /id:<SessionId> /j:<JournalFile> /id:<SessionId> [/logdir:<LogDirectory>] DataSet:<dataset.csv>

下面显示了一个导入示例。An import example is shown below.

WAImportExport.exe PrepImport /j:JournalTest.jrn /id:session#2  /DataSet:dataset-2.csv

后续步骤Next steps