使用 CSV 或 JSON 文件将任务批量上传到迁移管理器Bulk upload tasks into Migration Manager using a CSV or JSON file

有两种不同的方法可用于将任务批量上传到迁移管理器。There are two different methods available to bulk upload tasks into Migration Manager. 一种方法是使用逗号分隔值 (CSV) 文件,另一种方法是使用 JSON 文件。One is using a comma-separated (CSV) file, and the other is to use a JSON file.

条目由你按你选择的任何格式手动输入。The entries are manually entered by you into whichever format you choose. 验证第一行以确保目标链接有效。The first row is validated to make sure the destination links are valid. 如果收到无效目标错误,请确保同时检查任务的其余部分,确保它们具有有效的目标。If you receive an invalid destination error, make sure to also check the remainder of your tasks to ensure they have valid destinations.

备注

如果你正在迁移到 OneDrive 账户,确保迁移前预配置账户。If you are migrating to OneDrive accounts, make sure the accounts are pre-provisioned before you migrate. 你可以使用脚本,如此处所示:为组织内用户预配置 OndDriveYou can do this using a script, as shown here: Pre-provision OneDrive for users in your organization.

使用逗号分隔值 (CSV) 文件进行批量上传Using a comma-separated value (CSV) file for bulk upload

借助迁移管理器,可使用逗号分隔 (CSV) 文件批量迁移数据。Migration Manager lets you use a comma-separated (CSV) file to bulk migrate your data. 使用任意文本编辑器或 Excel 等应用程序创建 CSV 文件。Use any text editor, or an application like Excel, to create the CSV file.

CSV 文件格式CSV file format

CSV 文件需要六列 - 前三列是源值,每列提供有关数据当前位置的详细信息。There are six columns needed in your CSV file -- the first three are your source values, each providing detail about where your data is currently located. 剩余三列表示要将数据迁移到的位置(网站、文档库和可选子文件夹)。The remaining three columns indicate the site, document library and optional sub-folder to where you are migrating your data. 即使给定字段无需值,文件也必须包含全部六列。All six columns must be accounted for in the file, even if you are not needing a value for a given field.

以下是 CSV 文件的格式示例。Here's an example of the format for the CSV file. 行显示正从本地文件共享迁移过来的文件。The rows show files that are being migrated from local file shares.

提示

使用 CSV 文件下载批量上传模版:迁移管理器批量上传模版Download the template for bulk uploading using a CSV file: Migration Manager bulk upload template

使用 CSV 文件时的示例格式

此示例显示上述内容在 .txt 文件中的显示方式。This example shows how it would appear in a .txt file.

\\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/sitecollection,Documents,SubFolderName
\\MigrationTests\testfiles,,,https://contoso-my.sharepoint.com/personal/user_contoso_onmicrosoft_com,Documents,

重要

请勿 在 CSV 文件中包含标题行。Do not include a header row in your CSV file. 请记住,即使给定字段无需值,文件也必须包含全部六列。Remember to account for all six columns in the file, even if you are not needing a value for a given field. CSV 文件的编码必须为 UTF-8。The encoding of the CSV file must be UTF-8.

创建用于数据迁移的 CSV 文件To create a CSV file for data migration

以下示例使用 Excel 创建 CSV 文件。The following example uses Excel to create the CSV file.

  1. 启动 Excel。Start Excel.

  2. 输入迁移作业的值。每行输入一个迁移源和迁移目标。有关列的详细说明,请参阅以下参考表。Enter the values for your migration jobs. Enter one migration source and destination per row. See the reference table below for further explanation of columns.

    • 列 A: 输入文件共享路径。Column A: Enter a file share path. 必需。Required.

    • 列 B: 将此列留空 ****。Column B: Leave this column blank. 此列不适用于文件共享迁移。This column does not apply to file share migration.

    • 列 C: 将此列留空 ****。Column C: Leave this column blank. 此列不适用于文件共享迁移。This column does not apply to file share migration.

    • 列 D: 输入文件要迁移到的 SharePoint 网站 URL。Column D: Enter the SharePoint site URL where the files are to be migrated. 必需。Required.

    • 列 E: 输入文件要迁移到的 SharePoint 网站中文档库的名称。Column E: Enter the name of the document library in the SharePoint site where the files are to be migrated. 必需。Required.

    • 列 F: 在文档库中输入子文件夹的名称。如果将此列留空,则文件将被移至根级别。可选。Column F: Enter the name of the subfolder in the document library. If this column is left empty then the files will be moved to the root level. Optional.

  3. 关闭并另存为以逗号分隔的 (*.csv) 文件。Close and save as a Comma delimited (*.csv) file.

使用 JSON 文件进行批量上传Using a JSON file for bulk upload

以下示例显示在数据迁移中使用的 JSON 格式。The following example shows the JSON format used in migrating your data.

所需的最低值为 SourcePath、TargetPath 和 TargetList。The minimum required values are SourcePath, TargetPath and TargetList.


{

  "Tasks": [

    {
      "SourcePath": "\\\\contoso\\fileshare\\dept1",
      "TargetPath": "https://a830edad9050849387E18042320.sharepoint.com",
      "TargetList": "Documents",
      "TargetListRelativePath": "dept1",

      "Settings": {

        "MigrateHiddenItems": true,
        "MigrateItemsCreatedAfter": "2016-05-22",
        "MigrateItemsModifiedAfter": "2016-05-22",
        "SkipFilesWithExtensions": "txt:mp3",
        "FilterOutPathSpecialCharacters": false,
        "MigrateOneNoteNotebook": true
      }
    },

    {

      "SourcePath": "\\\\contoso\\fileshare\\dept2",
      "TargetPath": "https://a830edad9050849387E18042320.sharepoint.com",
      "TargetList": "Documents",
      "TargetListRelativePath": "dept2",

      "Settings": {

        "MigrateHiddenItems": true,
        "MigrateItemsCreatedAfter": "2016-05-22",
        "MigrateItemsModifiedAfter": "2016-05-22",
        "SkipFilesWithExtensions": "txt:mp3",
        "MigrateOneNoteNotebook": false,
        "FilterOutPathSpecialCharacters": false,

      }

    }
  ]
}