All Products
Search
Document Center

Data Online Migration:Preparations

最終更新日:Aug 09, 2024

This topic describes the operations that you must perform before you migrate data.

Step 1: Estimate the amount of data to be migrated

Estimate the size and number of files to be migrated.

Note

To ensure a successful migration, you must specify valid values for the size and number of files when you create a migration job.

Step 2: Upload a list file

  1. Create a list file on your on-premises device.

    The list file consists of two columns. Separate the columns with a tab character (\t). Each line represents one file. Separate files with line feeds (\n).

    • The first column contains a list of HTTP or HTTPS URLs. Data Online Migration uses HTTP GET requests to download files from the HTTP or HTTPS URLs and uses HTTP HEAD requests to obtain the metadata of the files. If a file name contains Chinese characters or special characters such as spaces, number signs (#), and tab characters, you must use the encodeURIComponent method to perform URL encoding on the file name.

    • The second column contains a list of file names. After a file is migrated, the name of the object that corresponds to the file consists of a prefix and the file name.

    If a file name contains Chinese characters or special characters, the file name must be URL-encoded in the first column, but does not need to be URL-encoded in the second column. For example, a file name is #<Chinese file name>2A.jpg, and the URL-encoded file name is %23%E5%9B%BE%E7%89%872A.jpg. In this case, enter the following information in the first and second columns of the list file to specify the file:

    http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/pics/%23%E5%9B%BE%E7%89%872A.jpg   pics/#<Chinese file name>2A.jpg
    Important
    • You must specify specific files instead of file folders in the list file.

    • If your device runs on a Windows operating system, we recommend that you use a text editor such as EditPlus or Sublime Text instead of Notepad to edit the list file. If your device runs on a Linux operating system, we recommend that you use Vi IMproved (Vim) to edit the list file.

    The following example shows the content of a list file named list.txt:

    http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/docs/my.doc    docs/my.doc
    http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/pics/my.jpg    pics/my.jpg
    http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/pics/#%EF%BF%A5.jpg    pics/#%EF%BF%A5.jpg
    http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/pics/%e5%9b%be%e7%89%87.jpg    pics/<Chinese file name>.jpg
  2. Upload the list file to Object Storage Service (OSS). For more information, see Simple upload.

    Note
    • After the list file is uploaded to OSS, Data Online Migration downloads the list file and migrates the files based on the specified URLs.

    • When you create a migration job, the OSS URL of a list file is in the oss://{Bucket name}/{List file name} format, such as oss://mybucket/list.txt.

Step 3: Create a destination bucket

Create a destination bucket in the OSS console to store the migrated data. For more information, see Create a bucket.

Step 4: Create a RAM user that is used to migrate data

To ensure data security, we recommend that you create a RAM role and attach the required policies to the RAM role based on the principle of least privilege for data migration.

  1. Log on to the RAM console.

  2. In the left-side navigation pane, choose Identities > Roles.

  3. On the Roles page, click Create Role.

  4. In the Select Role Type step of the Create Role wizard, select Alibaba Cloud Service and click Next.

  5. In the Selected Trusted Entity section, select Normal Service Role as Role Type, enter a RAM role name in the RAM Role Name field, and select Data Online Migration from the Select Trusted Service drop-down list. Then, click OK.

Step 5: Grant permissions to the RAM user

After the RAM user is created, go to the Users page in the RAM console. Find the RAM user that you want to manage and click Add Permissions in the Actions column to grant permissions to the RAM user.

  • System policy: AliyunMGWFullAccess, which grants full permissions on Data Transport

  • Custom policy:

    Grant the RAM user full permissions on the destination bucket

    Note
    • The following policy is for reference only. Replace mybucket with the name of the destination bucket.

    • For more information about RAM policies for OSS, see Common examples of RAM policies.

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": "oss:*",
                "Resource": [
                    "acs:oss:*:*:mybucket",
                    "acs:oss:*:*:mybucket/*"
                ]
            }
        ]
    }