All Products
Search
Document Center

Data Online Migration:Migrate data between NAS file systems

Last Updated:Dec 08, 2025

This topic describes how to use LocalFs to migrate data between Alibaba Cloud File Storage NAS (NAS) file systems.

Overview

Alibaba Cloud Data Online Migration supports data migration between Alibaba Cloud NAS file systems. Data Online Migration treats a NAS file system that is mounted to an Elastic Compute Service (ECS) instance as a local file system and uses a LocalFs source for the migration. For more information, see Tutorials for migrating data between LocalFS sources. This topic describes best practices for various NAS migration scenarios.

Warning

Data Online Migration does not guarantee the consistency between source data and migrated data during data migration. Ensure that you verify the migrated data at the destination data address after a migration task is complete. If you delete the data at the source data address before you verify the migrated data at the destination data address, you are liable for the losses and consequences caused by any data loss.

Migration flowchart

image

Before you begin

  • Create ECS instances on which agents are to be deployed

    • Each ECS instance must have at least 4 CPU cores, 8 GB of memory, and 20 GB of free disk space. For more information, see Select an agent.

    • If the migration speed of a single ECS instance is insufficient, use multiple ECS instances. The number of required ECS instances can be calculated as follows: Expected migration speed ÷ Migration speed of a single instance.

    • When you create ECS instances, ensure that the source NAS file system can be mounted to the source ECS instances and the destination NAS file system can be mounted to the destination ECS instances.

  • Manually mount NAS file systems

    • For migrations between NAS file systems, you must create separate tunnels for the source and destination data addresses.

    • If a tunnel has multiple agent instances, the local directory to which the NAS file system is mounted must be the same on each corresponding ECS instance. For example, the source tunnel has two agent instances deployed on two ECS instances. If the source NAS file system is mounted to the `/mnt/src/` local directory on the first ECS instance, it must also be mounted to `/mnt/src/` on the second ECS instance.

    • To mount a NAS file system, such as an NFS file system, use the NFS v3 protocol. For more information, see Mount an NFS file system:

      sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport file-system-id.region.nas.aliyuncs.com:/ /mnt

      The following table describes the parameters in the mount command.

      Parameter

      Description

      General-purpose NAS file system: file-system-id.region.nas.aliyuncs.com:/ /mnt

      Extreme NAS file system: file-system-id.region.extreme.nas.aliyuncs.com:/share /mnt

      Indicates <mount_address>:<NAS_file_system_directory> <local_path_to_mount>. Replace the variables as needed.

      • mount_address: Get the mount address on the File System List page in the File Storage NAS console. Click Manage next to the target file system and go to the Mount Targets page. For more information, see Manage mount targets.

      • NAS_file_system_directory: The root directory (/) or any subdirectory (for example, /share) of the NAS file system. If you specify a subdirectory, ensure the subdirectory exists in the NAS file system.

        Note

        The shared directory for an Extreme NAS file system must start with /share, such as /share or /share/subdir.

      • local_path_to_mount: The root directory (/) or any subdirectory (for example, /mnt) on the Linux ECS instance. If you specify a subdirectory, ensure the subdirectory exists.

      vers

      The version of the file system.

      • vers=3: Mounts the file system using the NFS v3 protocol.

      • vers=4: Mounts the file system using the NFS v4 protocol. minorversion is the minor version number of the protocol. NAS supports NFS v4.0. Therefore, when you mount a file system using the NFS v4 protocol, the minor version number is 0.

      Note
      • General-purpose NAS file system: Supports NFS v3 and NFS v4.0.

      • Extreme NAS file system: Supports only NFS v3. NFS v4 is not supported.

      Mount options

      You can select multiple mount options. Separate the options with commas (,). The options are described as follows:

      • rsize: Defines the size of the data block for reading data between the client and the file system. Recommended value: 1048576.

      • wsize: Defines the size of the data block for writing data between the client and the file system. Recommended value: 1048576.

        Note

        To change the I/O size parameters (rsize and wsize), use the maximum value (1048576) to avoid performance degradation.

      • hard: If the File Storage NAS is temporarily unavailable, local applications that use a file on the file system will stop and wait until the file system is back online. We recommend that you enable this parameter.

      • timeo: Specifies the duration, in tenths of a second, that the NFS client waits for a response before it retries a request to the file system. Recommended value: 600 (60 seconds).

        Note

        If you must change the timeout parameter (timeo), we recommend that you use a value of 150 or greater. The unit for the timeo parameter is a tenth of a second, so 150 represents 15 seconds.

      • retrans: The number of times the NFS client retries a request. Recommended value: 2.

      • noresvport: Uses a new TCP port when the network reconnects to ensure the connection is not interrupted during network fault recovery. We recommend that you enable this parameter.

      Important
      • We do not recommend using the soft option due to data consistency threats. If you use the soft option, you are responsible for any associated threats.

      • Avoid setting any other mount options that differ from the default values. If you change the read or write buffer sizes or disable attribute caching, performance may decrease.

Important

Ensure that you mount a NAS file system using the commands and parameters to the specified directory on an ECS instance and the mounted NAS file system is available during data migration. Otherwise, data may be written to a local disk instead of the NAS file system. If you have any questions about mounting a NAS file system, contact the technical support of NAS.

Migration tutorial

Migrate data between NAS file systems in the same way as you migrate data between local file systems. For more information about the tutorial, see Migrate data between local file systems.

Important

The migration speed is affected by multiple factors, including the network condition, the file system performance, and the directory structure. For example, the migration speed is affected by the length and latency of the network link, the read and write speed of NAS, whether files are stored in a single directory, the number and levels of directories in the source NAS file system, and the average file size. The number of ECS instances that you calculate for a tunnel is for reference only. The actual migration speed may fail to meet your expectation.

Examples

Example 1: Migrate data between NAS file systems that reside in the same region and VPC

Assume the source NAS instance is in the China (Beijing) region. The mount target's VPC is vpc-nas and the vSwitch is vsw-nas. The source NAS contains 200 TB of data to be migrated. The destination NAS instance is also in the China (Beijing) region. Its mount target's VPC is also vpc-nas and the vSwitch is also vsw-nas. The destination file system is empty. The expected migration speed is 2 Gbps.

Perform the following steps:

  1. Determine the hardware configuration for the agent ECS instances. For this example, a single ecs.c7.xlarge instance is used, which provides 4 CPU cores, 8 GB of memory, and 3 Gbps of baseline bandwidth.

  2. Calculate the number of ECS instances required for each tunnel: 2 Gbps (Expected migration speed) ÷ 3 Gbps (Migration speed of a single instance) = 0.6 ≈ 1. Therefore, one ECS instance is required for the source NAS and one for the destination NAS.

  3. In the ECS console, create one ECS instance of the ecs.c7.xlarge type for the source NAS file system and another of the same type for the destination NAS file system. Select the China (Beijing) region, the vpc-nas VPC, and the vsw-nas vSwitch when you create the ECS instances. Name the ECS instances ECS-1 and ECS-2.

  4. Log on to ECS-1 as an administrator, create the /mnt/src/ directory, and then mount the source NAS file system to the directory. Log on to ECS-2 as an administrator, create the /mnt/dest/ directory, and then mount the destination NAS file system to the directory.

    Important

    Ensure that the NAS file systems are mounted to the specified directories and the NAS file systems are available during data migration.

  5. Migrate data in the Data Online Migration console in the China (Beijing) region. For more information, see Migrate data between local file systems.

    1. Create a source tunnel. Create a source agent. Set the Network Type parameter to Leased Line/VPN (VPC), and associate the agent with the source tunnel. Deploy the agent on ECS-1.

    2. Create a destination tunnel. Create a destination agent. Set the Network Type parameter to Leased Line/VPN (VPC), and associate the agent with the destination tunnel. Deploy the agent on ECS-2.

    3. Create a data address for the source NAS file system. Associate the data address with the source tunnel, and select the source agent. Set the Directory to Be Migrated parameter to /mnt/src/.

    4. Create a data address for the destination NAS file system. Associate the data address with the destination tunnel, and select the destination agent. Set the Directory to Be Migrated parameter to /mnt/dest/.

    5. Create a migration task using the source and destination data addresses.

Example 2: Migrate data between NAS file systems that reside in the same region but different VPCs

Assume the source NAS instance is in the China (Beijing) region. The mount target's VPC is vpc-nas-1 and the vSwitch is vsw-nas-1. The source NAS contains 200 TB of data to be migrated. The destination NAS instance is also in the China (Beijing) region. Its mount target's VPC is vpc-nas-2 and the vSwitch is vsw-nas-2. The destination file system is empty. The expected migration speed is 2 Gbps.

Perform the following steps:

  1. Determine the hardware configuration for the agent ECS instances. For this example, a single ecs.c7.xlarge instance is used, which provides 4 CPU cores, 8 GB of memory, and 3 Gbps of baseline bandwidth.

  2. Calculate the number of ECS instances required for each tunnel: 2 Gbps (Expected migration speed) ÷ 3 Gbps (Migration speed of a single instance) = 0.6 ≈ 1. Therefore, one ECS instance is required for the source NAS and one for the destination NAS.

  3. In the ECS console, create one ECS instance of the ecs.c7.xlarge type for the source NAS file system. Select the China (Beijing) region, the vpc-nas-1 VPC, and the vsw-nas-1 vSwitch when you create the ECS instance. Name the ECS instance ECS-1. Similarly, create one ECS instance of the ecs.c7.xlarge type for the destination NAS file system. Select the China (Beijing) region, the vpc-nas-2 VPC, and the vsw-nas-2 vSwitch when you create the ECS instance. Name the ECS instance ECS-2.

  4. Log on to ECS-1 as an administrator, create the /mnt/src/ directory, and then mount the source NAS file system to the directory. Log on to ECS-2 as an administrator, create the /mnt/dest/ directory, and then mount the destination NAS file system to the directory.

    Important

    Ensure that the NAS file systems are mounted to the specified directories and the NAS file systems are available during data migration.

  5. Migrate data in the Data Online Migration console in the China (Beijing) region. For more information, see Migrate data between local file systems.

    1. Create a source tunnel. Create a source agent. Set the Network Type parameter to Leased Line/VPN (VPC), and associate the agent with the source tunnel. Deploy the agent on ECS-1.

    2. Create a destination tunnel. Create a destination agent. Set the Network Type parameter to Leased Line/VPN (VPC), and associate the agent with the destination tunnel. Deploy the agent on ECS-2.

    3. Create a data address for the source NAS file system. Associate the data address with the source tunnel, and select the source agent. Set the Directory to Be Migrated parameter to /mnt/src/.

    4. Create a data address for the destination NAS file system. Associate the data address with the destination tunnel, and select the destination agent. Set the Directory to Be Migrated parameter to /mnt/dest/.

    5. Create a migration task using the source and destination data addresses.

Example 3: Migrate data between NAS file systems that reside in different regions and different VPCs

Assume the source NAS instance is in the China (Beijing) region. The mount target's VPC is vpc-nas-1 and the vSwitch is vsw-nas-1. The source NAS contains 200 TB of data to be migrated. The destination NAS instance is in the China (Hangzhou) region. Its mount target's VPC is vpc-nas-2 and the vSwitch is vsw-nas-2. The destination file system is empty. The expected migration speed is 5 Gbps.

Perform the following steps:

  1. Because the NAS file systems are in different regions, you cannot directly mount the NAS file system in the China (Hangzhou) region to an ECS instance in the China (Beijing) region. You must first use Alibaba Cloud Enterprise Network (CEN) to enable cross-region mount access. For more information, see Mount a NAS file system across accounts and regions using CEN.

  2. Determine the hardware configuration for the agent ECS instances. For this example, a single ecs.c7.xlarge instance is used, which provides 4 CPU cores, 8 GB of memory, and 3 Gbps of baseline bandwidth.

  3. Calculate the number of ECS instances required for each tunnel: 5 Gbps (Expected migration speed) ÷ 3 Gbps (Migration speed of a single instance) = 1.6 ≈ 2. Therefore, two ECS instances are required for the source NAS and two for the destination NAS.

  4. In the ECS console, create two ecs.c7.xlarge instances named ECS-Src1 and ECS-Src2 for the source NAS. When you create the instances, select the China (Beijing) region, the vpc-nas-1 VPC, and the vsw-nas-1 vSwitch. Then, create two ecs.c7.xlarge instances named ECS-Dst1 and ECS-Dst2 for the destination NAS. These instances must also be created in the China (Beijing) region.

  5. Log on to ECS-Src1 and ECS-Src2 as an administrator, create the `/mnt/src/` directory, and mount the source NAS to this directory. Then, log on to ECS-Dst1 and ECS-Dst2 as an administrator, create the `/mnt/dest/` directory, and mount the destination NAS to this directory.

    Important

    Ensure that the NAS file systems are mounted to the specified directories and the NAS file systems are available during data migration.

  6. In the Data Online Migration console for the China (Beijing) region, migrate the data. For more information, see Tutorials for migrating data between LocalFS sources.

    1. Create a source tunnel. Create two source agents, set the Network Type parameter to Leased Line/VPN (VPC), and associate them with the source tunnel. Deploy the two agents on ECS-Src1 and ECS-Src2.

    2. Create a destination tunnel. Create two destination agents, set the Network Type parameter to Leased Line/VPN (VPC), and associate them with the destination tunnel. Deploy the two agents on ECS-Dst1 and ECS-Dst2.

    3. Create a data address for the source NAS file system. Associate the data address with the source tunnel, and select the source agents. Set the Directory to Be Migrated parameter to /mnt/src/.

    4. Create a data address for the destination NAS file system. Associate the data address with the destination tunnel, and select the destination agents. Set the Directory to Be Migrated parameter to /mnt/dest/.

    5. Create a migration task using the source and destination data addresses.

Usage notes

  • You must start the agents as an administrator.

    • The agents associated with the source data address must have the permissions to read all files and subdirectories in the directories of the source NAS file system. Otherwise, the agents fail to read data from the NAS file system, and the data migration fails.

    • The agents associated with the destination data address must have the read and write permissions on all files and subdirectories in the directories of the destination NAS file system. Otherwise, the agents fail to read data from and write data to the NAS file system,and the data migration fails.

  • If a NAS file system has many directories and each directory contains a small number of files, the files may be scanned at a low speed. For example, if the source NAS file system stores 1 million files that are distributed in 500,000 directories, the files are scanned at a lower speed than that if the files are distributed in 10,000 directories.

  • If more than 200,000 files are stored in the same directory, the migration speed may be low due to the concurrency limit of the operating system kernel of the ECS instances on which the agents are deployed and the concurrency limit of the NAS file systems.

  • If an excessively large number of files are stored in a directory or the directory is being modified, the NAS file system may give a slow response or not respond when you perform a list operation on the directory. The migration task may be interrupted. For more information, see Why does a file system stutter or not respond when I run the ls command?