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 the number of objects that you want to migrate. You can log on to the Linux-based FTP server to view the size and number of files that you want to migrate.
Only a root user with super administrator permissions can execute the following commands. Proceed with caution.
Log on to the Linux-based FTP server and run the following command as a root user:
ftp <ftp_server_ip>
Enter the username and password.
Run the following commands to view the size and number of files that you want to migrate:
Size of files: du -sh
<directory_path>
Number of files: find
<directory_path>
-type f | wc -lExamples:
[root@ixxx /]# du -sh /root/a/b/c 181M /root/a/b/c [root@ixxx /]# find /root/a/b/c -type f | wc -l 38
To ensure that data can be migrated as expected, you must specify an appropriate size and number of objects when you create a migration task.
Step 2: 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 3: Create a RAM role 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.
Log on to the RAM console.
In the left-side navigation pane, choose
.On the Roles page, click Create Role.
In the Select Role Type step of the Create Role wizard, select Alibaba Cloud Service and click Next.
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 4: 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
NoteThe 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/*" ] } ] }