This topic describes how to migrate data by using Data Online Migration.
Usage notes
- Data Online Migration uses the standard and publicly available API operations provided by the storage service provider of the source data address to access the source data. The data accessed by Data Online Migration depends on the specific API operations that are implemented by the service provider.
- A migration job occupies the network resources of the source and destination data addresses. To ensure business continuity, we recommend that you specify a rate limit for your migration job or run your migration job during off-peak hours.
- Before a migration job starts, the system checks the files at the source data address and the destination data address. If the source and destination data addresses have files with the same name, and the last modification time of the source file is later than the last modification time of the destination file, the destination file is overwritten. If both files contain different information, we recommend that you change the name of one file or back up the destination file.
- If symbolic links exist at the source data address, the files or directories to which the symbolic links point are migrated to the destination data address. The migrated files are named after the symbolic links. Examples:
- If a symbolic link points to a file, a symbolic link named a exists at Source Data Address A, and the file to which the symbolic link points is b.jpg, b.jpg is migrated to the destination data address and renamed a.
- If a symbolic link points to a directory, a symbolic link named b.txt exists at Source Data Address B, and the directory to which the symbolic link points is c/, c/ is migrated to the destination data address and renamed b.txt/.
Note If the files to be migrated contain symbolic links, the migration workload may be greater than estimated, and the migration may continue even if the displayed migration progress reaches 100%. The migration duration varies based on the actual migration workload. - The following unconventional types of disk files cannot be migrated:
- Block device file
- Character device file
- First in, first out (FIFO) file or pipeline file
- Socket file
- Files of other types that cannot be recognized by file systems or operating systems
- Empty directories that exist at the source data address are skipped during data migration.
Step 1: Create a source data address
- Log on to the Alibaba Cloud Data Transport console.
- In the left-side navigation pane, choose Create Data Address. . On the page that appears, click
- In the Create Data Address panel, set the parameters and click OK. The following table describes the parameters.
Parameter Required Description Data Type Yes Select NAS. Data Name Yes Enter a name. The name must be 3 to 63 characters in length. The name cannot contain special characters except for hyphens (-) and underscores (_). Data Region Yes Select the region in which the Network Attached Storage (NAS) file system resides. If you select Alibaba Cloud as NAS Type, select the region in which the Apsara File Storage NAS file system resides. If you select Others as NAS Type, select the region of the Alibaba Cloud virtual private cloud (VPC) to which the third-party NAS file system is mounted.
NAS Type Yes Select the type of the source NAS file system. Valid values: - Alibaba Cloud: a NAS file system that is created on Alibaba Cloud.
- Others: a NAS file system that is created on a third-party platform. You must mount the file system to an Alibaba Cloud VPC.
File System This parameter is required only if you select Alibaba Cloud as NAS Type. Select the NAS file system whose data you want to migrate. Mount Point This parameter is required only if you select Alibaba Cloud as NAS Type. Select the mount target of the NAS file system. Important You can mount the NAS file system only to a mount target that resides in a VPC. Mount targets in the classic network are not supported.VPC This parameter is required only if you select Others as NAT Type. Select a VPC to which the NAS file system is mounted. Switches This parameter is required only if you select Others as NAT Type. Select a vSwitch for the NAS file system. NAS Address This parameter is required only if you select Others as NAT Type. Enter the IP address of the NAS server. This IP address must be accessible to the VPC. Sub Folder No Enter the directory in which the data you want to migrate is stored. If you do not specify this parameter, the root directory (/) is used by default. Important If you specify a subdirectory, make sure that the subdirectory exists on the NAS server. Otherwise, the source data address fails to be created.Connection Method This parameter is required only if you select Others as NAT Type. Select a protocol type. Connection Password This parameter is required only if you select Others as NAT Type. Specify whether a password is required. Valid values: - No Password: No password is required to access the NAS file system.
- Use Password: A username and a password are required to access the NAS file system. You must enter a valid username and a valid password.
Note For more information about the status of a data address, see View the status of a data address.
Step 2: Create a destination data address
- In the left-side navigation pane, choose Create Data Address. . On the page that appears, click
- In the Create Data Address panel, set the parameters and click OK. The following table describes the parameters.
Parameter Required Description Data Type Yes Select OSS. Data Name Yes Enter a name. The name must be 3 to 63 characters in length. The name cannot contain special characters except for hyphens (-) and underscores (_). Data Region Yes Select the region in which the destination data address resides. Enable Transfer Acceleration No If you want to use Data Online Migration together with the transfer acceleration feature of OSS, enable the transfer acceleration feature for buckets. The transfer acceleration feature takes effect within 30 minutes after it is enabled. After you enable the feature, wait for 30 minutes before you create a migration job. Important If you use the transfer acceleration feature to access OSS buckets, you are charged additional transfer acceleration fees. For more information, see Enable transfer acceleration.OSS Endpoint Yes Select an endpoint in the region in which your data is stored. For more information, see Regions and endpoints. Access Key Id Yes Specify the AccessKey pair that is used to migrate data. For more information, see Prerequisites. Access Key Secret Yes OSS Bucket Yes Select a bucket to store the migrated data. OSS Prefix No An OSS prefix cannot start with a forward slash (/) but must end with a forward slash (/). For example, you can specify data/to/oss/
as the OSS prefix. If you want to migrate data to the root directory of the specified bucket, do not set this parameter.
Step 3: Create a migration job
- In the left-side navigation pane, choose Create Job. . On the page that appears, click
- In the Create Job panel, read the terms of the migration service and select I agree to the above terms and activate the Data Transport service. Then, click Next.
- In the Fee Reminder message, click Yes, Go Ahead.
- In the Job Config step, set the parameters and click Next. The following table describes the parameters.
Parameter Required Description Job Name Yes Enter a job name. The name must be 3 to 63 characters in length and can contain only lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen (-). Source Data Address Yes Select the source data address that you created. Destination Data Address Yes Select the destination data address that you created. Specified Directory No Specify the directories in which the files and subdirectories are migrated or not migrated. Valid values: - Do not filter: migrates all data from the source data address.
- Exclude: does not migrate the files or subdirectories in the specified directories.
For example, you want to migrate all the directories in the
root_dir/
directory exceptroot_dir/bad_sub1/
androot_dir/bad_sub2/
. In this case, you can select this method and specifybad_sub1/
andbad_sub2/
. - Contain: migrates only the files and subdirectories in the specified directories.
For example, you want to migrate only
root_dir/good_sub1/
androot_dir/good_sub2/
in theroot_dir/
directory. In this case, you can select this method and specifygood_sub1/
andgood_sub2/
.
Note- A directory name cannot start with a forward slash (/) or a backslash (\), and cannot contain double forward slashes (//), double periods (..), or double quotation marks ("). The character string that consists of all the specified directory names cannot exceed 10 KB in length.
- A directory name must end with a forward slash (/). For example, you can specify docs/ as a directory name.
- You can specify up to 20 directories that you want to include or exclude.
Migration Type Yes Select the data migration mode. Valid values: - Full: The system migrates all data from the source data address to the destination data address. You must configure the Start Time Point of File parameter. The system migrates all data whose last modification time is later than the specified time. After all data is migrated, the migration job ends.
If you change the data at the source data address after the migration job is complete, you can submit another job to migrate all data. In this case, the system migrates only the changed data.
- Incremental: The system runs a migration job based on the values that you specified for the Migration Interval and Migration Times parameters.
- You must configure the Start Time Point of File parameter. During the first migration, the system migrates all data whose last modification time is later than the specified time. After the first migration is complete, incremental migration is performed based on the value that you specified for the Migration Interval parameter. For each incremental migration, the system migrates only the data that is created or modified after the previous migration starts and before the current migration starts.
- If you set the Migration Times parameter to N, full migration is performed once and then incremental migration is performed (N - 1) times.
For example, the current time is 08:00, March 10, 2019 and you set the Migration Interval parameter to 1, the Migration Times parameter to 5, and the Start Time Point of File parameter to 08:00, March 5, 2019. When the first migration starts, the system migrates all files whose last modification time is between 08:00, March 5, 2019 and 08:00, March 10, 2019. In this example, the first migration requires one hour to complete and the second migration starts at 10:00, March 10, 2019. The duration from 08:00 to 10:00 consists of one hour for the first migration process and one hour for the migration interval. During the second migration, the system migrates the files whose last modification time is between 08:00, March 10, 2019 and 10:00, March 10, 2019. The migration job consists of one full migration and four incremental migrations.
Important Before full or incremental migration starts, the system compares the files at the source data address with the files at the destination data address. If a source file has the same name as a destination file, the destination file is overwritten when one of the following conditions is met:- The Content-Type values of the source file and the destination file are different.
- The last modification time of the source file is later than that of the destination file.
- The size of the source file is different from that of the destination file.
Start Time Point of File Yes Specify a time to filter data to be migrated. Data will be migrated if it is created or modified after the specified time. Valid values: - All: migrates all files.
- Assign: migrates only the files that are created or modified after the specified time.
For example, if you set the time to 08:00:00, November 1, 2018, only the files that are created or modified after 08:00:00, November 1, 2018 are migrated.
Migration Interval This parameter is required if you set the Migration Type parameter to Incremental. The default value is 1, and the maximum value is 24. Unit: hours. Migration Times This parameter is required if you set the Migration Type parameter to Incremental. The default value is 1, and the maximum value is 30. File Overwrite Method Yes The method that is used to process the source file whose name is the same as that of a destination file. Valid values: - LastModified: If a source file has the same name as a destination file, the system compares the last modification time that is indicated by the LastModified property of the files.
- If the last modification time of the source file is later than that of the destination file, the source file is migrated and the destination file is overwritten.
- If the last modification time of the source file is earlier than that of the destination file, the source file is not migrated and the destination file is retained.
- If the two files have the same last modification time, the system checks the values of the Size and Content-Type properties of the files.
If the two files have the same Size and Content-Type values, the source file is not migrated. If the two files have different values of at least one property, the source file is migrated and the destination file is overwritten.
- Condition: If a source file has the same name as a destination file, the system compares the values of the LastModified, Size, and Content-Type properties of the two files.
- If all property values of the two files are the same, the source file is not migrated.
- If the two files have different values of at least one property, the source file is migrated and the destination file is overwritten.
- All: If a source file has the same name as a destination file, the system performs no comparison and directly overwrites the destination file with the source file.
- No: If a source file has the same name as a destination file, the system performs no comparison and directly skips the source file during the migration.
- In the Performance step, go to the Data Prediction section and set the Data Size and File Count parameters. Note To ensure a successful migration job, we recommend that you estimate the amount of data that you want to migrate as accurately as possible. For more information, see Before you begin.
- Optional:In the Performance step, go to the Flow Control section, set the Time Range and Max Flow(MB/s) parameters, and then click Add. Note To ensure business continuity, we recommend that you set the Time Range and Max Flow(MB/s) parameters based on the workloads during peak hours and off-peak hours.
- Click Create and wait until the migration job is complete.
View the status of a data address
- Normal: The data address is created.
- Creating: The data address is being created. The system requires approximately 3 minutes to create the first NAS data address. If the data address remains in the Creating state for an extended period of time, you can click Refresh in the upper-right corner to check the most recent state of the data address.
- Invalid: An exception has occurred in the process of creating the address. Check your settings and verify whether Data Online Migration can access the NAS service. If the exception persists, submit a ticket.
Customer use cases
For more information about an example of migrating data from a NAS file system to an OSS bucket, see Migrate data from an on-premises NAS file system to OSS for an entertainment company.