This topic describes how to migrate data between Alibaba Cloud virtual machines (VMs)

Background information

If you want to migrate data between Alibaba Cloud VMs, we recommend that you use the Copy Image and Share Image features. For more information, see Copy custom images and Share or unshare a custom image. If these two features cannot meet your business needs, you can use the methods that are described in the following scenarios: After the preparations are complete, you can start the migration. For more information, see Migrate data between Alibaba Cloud VMs. If you migrate a VM for the first time, we recommend that you perform a test migration.

Migrate data between Alibaba Cloud VMs within the same virtual private cloud (VPC)

You can use this migration method to decrease the disk size of an Elastic Compute Service (ECS) instance. For more information, see Decrease the size of a disk.

We recommend that you select VPC as the network type when you create a migration task. Compared with migration over the Internet, migration over a VPC is more efficient and stable.

Migrate data between Windows-based Alibaba Cloud VMs across VPCs

You can use this migration method to migrate data between Windows-based Alibaba Cloud VMs across accounts, regions, or VPCs.

Before the migration, perform the following operations:
  • Create snapshots to back up data.
  • Check the validity of your application licenses.

    After you migrate data between Alibaba Cloud VMs across VPCs, the application licenses that are associated with the underlying hardware may become invalid.

  • Check the network environment.
    • If you perform migration across regions outside mainland China, the network may become unstable.
    • If a VPC is available, we recommend that you perform migration over the VPC. Compared with migration over the Internet, migration over a VPC is more efficient and stable.
  • Make sure that the Volume Shadow Copy Service (VSS) is enabled.
  • Check whether the QEMU Guest Agent is installed. If the QEMU Guest Agent is installed, you must uninstall it. For more information, see What can I do if Windows server migration stops in the "Prepare For Rsync Disk 0" stage?

Migrate data between Linux-based Alibaba Cloud VMs across VPCs

You can use this migration method to migrate data between Linux-based Alibaba Cloud VMs across accounts, regions, or VPCs.

Before the migration, perform the following operations:
  • Create snapshots to back up data.
  • Check the validity of your application licenses.

    After you migrate data between Alibaba Cloud VMs across VPCs, the application licenses that are associated with the underlying hardware may become invalid.

  • Check the network environment.
    • If you perform migration across regions outside mainland China, the network may become unstable.
    • If a VPC is available, we recommend that you perform migration over the VPC. Compared with migration over the Internet, migration over a VPC is more efficient and stable.

Migrate data between Alibaba Cloud VMs

For more information, see Before you begin.

  1. Download and decompress the SMC client package.
    1. Download the SMC client package.
      If the migration source has access to the Internet, you can also download the SMC client package to the migration source.
      Note You can log on to the SMC console. In the upper-right corner of the page, click Download Latest SMC Client to download the latest version of the SMC client.
    2. Upload the SMC client package to the migration source.
    3. Decompress the SMC client package.
      The SMC client is available for different operating systems and architectures. Select an SMC client version that is compatible with the migration source.
      The following figure shows the decompressed client folders for Windows.
      Note For Linux systems, run the unzip <name of the SMC client package> command to decompress the SMC client package. Make sure that the unzip utility is installed on the source server. For example, you can run the yum -y install unzip command to install the unzip utility in CentOS 7.
      553
      Table 1. SMC client packages
      Client package Architecture Operating system Bits Supported destination image types
      go2aliyun_client2.5.8_linux_arm64.zip ARM Linux 64
      • ECS image
      • ECS instance
      go2aliyun_client2.5.8_linux_i386.zip x86 Linux 32
      • ECS image
      • ECS instance
      • Container image
      go2aliyun_client2.5.8_linux_x86_64.zip x86 Linux 64
      go2aliyun_client2.5.8_windows_i386.zip x86 Windows 32
      • ECS image
      • ECS instance
      go2aliyun_client2.5.8_windows_x86_64.zip x86 Windows 64
      Note
      • The version number 2.5.8 in the name of the client package is for reference only. The actual version number shall prevail.
      • SMC allows you to migrate Linux servers of the ARM64 architecture to ECS instances of the g6r or c6r instance family. For more information, see Instance families.
    4. Decompress the client package that is compatible with the operating system of your source server.
      The following figure shows the directories and files in the decompressed folder. Home directory of the client
      Table 2. SMC client folders and files
      Folder or file Description
      go2aliyun_client.exe The Windows CLI executable file.
      go2aliyun_gui.exe The Windows GUI executable file. For more information about the GUI version, see Use the Windows GUI version of an SMC client.
      go2aliyun_client The Linux CLI executable file.
      user_config.json The configuration file of the migration source and destination.
      Excludes The folder in which to add directories to exclude from migration.
      client_data The migration data file. This includes the intermediate instance information and migration progress.
  2. Optional:Optional. Exclude files or directories from migration. If you do not need some files or directories after migration, you can exclude them from migration. For more information, see How do I exclude files or directories from a migration task?.
    Note If you enable the block replication feature, you cannot exclude files or directories from migration.
  3. Run the SMC client to import the migration source information.
    1. Enter the SMC client folder and run the SMC client.
      • For Windows servers, use one of the following methods to run the SMC client:
        • To run the Windows GUI version, double-click the go2aliyun_gui.exe file.
        • To run the Windows CLI version, double-click the go2aliyun_client.exe file.
        Note When you run the program, you must click OK to confirm that you have the administrator privilege.
      • For Linux servers, run the SMC client as a root or sudo user.
        • In the directory of the go2aliyun_client file, run the following commands as the root user:
          chmod +x go2aliyun_client
          ./go2aliyun_client
        • In the directory of the go2aliyun_client file, run the following commands with the sudo permission:
          sudo chmod +x ./go2aliyun_client
          sudo ./go2aliyun_client
        If you have required permissions on the migration source system, you can also run the following commands to import the migration source information. In this case, you do not need to enter your AccessKey pair.
        Note An AccessKey pair of an Alibaba Cloud account includes an AccessKey ID and AccessKey secret. If you have not created an AccessKey pair, create one first. For more information, see Create an AccessKey pair.
        • Run the following command as a root user:
          ./go2aliyun_client --accessid=<AccessKey ID> --secretkey=<AccessKey Secret>
        • Run the following command as a sudo user:
          sudo ./go2aliyun_client --accessid=<AccessKey ID> --secretkey=<AccessKey Secret>
    2. Enter the AccessKey pair of your Alibaba Cloud account.
      Note If the AccessKey pair you entered is invalid, open the user_config.json file, delete the access_id and secret_key values, and then run the client again.
      • For Windows servers
        • If you use the Windows GUI version, enter the AccessKey ID in the Access Id field, enter the AccessKey secret in the Secret Key field, and then click Start. For more information, see Use the Windows GUI version of an SMC client.
        • If you use the Windows CLI version, enter the AccessKey ID and AccessKey secret, and then press Enter.
      • For Linux servers
        Enter the AccessKey ID and AccessKey secret, and then press Enter. Enter the AccessKey pair
        The following prompts may appear:
        • If no snapshot dependency is installed on your source server, the following prompt appears, as shown in the following figure. Decide whether to install one based on whether you need to enable block replication.
          • If you need to enable block replication for the migration, enter yes to automatically install a snapshot dependency.
          • If you do not need to enable block replication for the migration, enter no.
          Note If the snapshot dependency fails to be installed, do not enable block replication when you create a migration task. Otherwise, the migration may fail.
          123
        • The rsync tool is installed in most mainstream migration sources. If rsync is not installed on the migration source, the SMC client displays a prompt. Enter yes to install rsync, as shown in the following figure. Install rsync
        • If SELinux is enabled on the migration source, you are prompted to disable SELinux. Enter yes to disable SELinux, as shown in the following figure. Disable SELinux
    Notice Do not close the client until the migration is complete. Otherwise, the migration source will be disconnected from the SMC console and the migration fails.
  4. Log on to the SMC console.
  5. Create a migration task.
    1. In the left-side navigation pane, click Migration Sources.
    2. Find the migration source, and click Create Migration Task in the Actions column.
      You can obtain the ID of the migration source from the SMC client, as shown in the following figure. Then, you can use the ID to find the migration source in the SMC console. For more information, see Step 1: Import the information of a migration source. Obtain the ID of the migration source
    3. In the Create Migration Task panel, read the instructions and set the parameters for the migration task.

      The Basic Configuration section includes the following parameters:

      • Target Region: Required. The ID of the destination region. For more information about Alibaba Cloud regions, see Regions and zones.
      • Task name: the name of the migration task.
        Note The task name must be unique within an Alibaba Cloud region.
      • Description: the description of the migration task.
      • Target Disk Size (GiB): the disk configuration of the destination server. adad

        The following table describes the parameters.

        Parameter Required Description
        Enable Block Replication No
        • If you select Enable Block Replication, stable data transmission is ensured. The block replication feature also ensures that the source and destination disks use the same partitioning scheme. You cannot modify the size of each partition in the destination disk. After you select Enable Block Replication, the Whether to enable block replication switch appears next to Partition <N>.
        • If you clear Enable Block Replication, SMC uses the default method to migrate the migration source. You can modify the size of each partition in the destination disk.
        Note If your source server runs Windows, block replication is enabled by default. Do not disable it.
        System Disk Yes
        • System Disk: the system disk size of the destination ECS instance. Unit: GiB. Valid values: 20 to 500. The size of the destination system disk must be greater than the amount of data in the source system disk. For example, if the total size of the source system disk is 400 GiB but the size of data stored in this disk is only 100 GiB, you must set this parameter to a value greater than 100 GiB.
          Note The default value of this parameter is the size of the source system disk. We recommend that you retain the default value or specify a greater value.
        • Partition <N>: SMC generates a partitioning scheme for the destination system disk based on that of the source system disk. Unit: GiB. Valid values: 0 to 98. N indicates the serial number of the partition. For example, if the system disk of the migration source has only one partition, Partition 0 is generated.
        • Whether to enable block replication: This switch is available only when you select Enable Block Replication. SMC allows or disallows you to turn on the switch based on whether the migration source supports block replication.
          • If the migration source does not support block replication for partitions, you cannot turn on the switch.
          • If the migration source supports block replication for partitions, you can turn on the switch to migrate disk data at the partition level.
        Data Disk <N> No
        • Data Disk <N>: the data disk size of the destination ECS instance. Unit: GiB. Valid values: 20 to 32768.
          • If you select the Data Disk <N> check box, a destination data disk is generated.
          • N indicates the serial number of the data disk.
          • The size of the destination data disk must be greater than that of the existing data in the source data disk. For example, if the total size of the source data disk is 500 GiB but the size of data stored in the disk is only 100 GiB, you must set this parameter to a value greater than 100 GiB.
        • Partition <N>: SMC generates a partitioning scheme for the destination data disk based on that of the source data disk. Unit: GiB. Valid values: 0 to 141. N indicates the serial number of the partition. For example, if a data disk of the migration source has only one partition, Partition 0 is generated.
        • Whether to enable block replication: This switch is available only when you select Enable Block Replication. SMC allows or disallows you to turn on the switch based on whether the migration source supports block replication.
          • If the migration source does not support block replication for partitions, you cannot turn on the switch.
          • If the migration source supports block replication for partitions, you can turn on the switch to migrate disk data at the partition level.
        Note Data Disk <N> is available only if the migration source has a data disk. For more information, see SMC FAQ.
      • Resource Type: the type of the destination image. Valid values:
        • ECS Image. The following table describes the parameters.
          Parameter Required Description
          Image Name No The name of the destination ECS image generated by SMC for the migration source.
          Note The image name must be unique within an Alibaba Cloud region.
          License Type Yes The license type.
          Automatic Incremental Synchronization No Specifies whether SMC automatically synchronizes incremental data of the migration source to Alibaba Cloud.
          • To enable this feature, you must set the following parameters:
            • Synchronization Interval: the interval at which SMC automatically synchronizes incremental data to Alibaba Cloud.
            • Upperlimit of Reserved Images: the maximum number of images that can be retained during incremental migration.
            SMC automatically synchronizes incremental data to Alibaba Cloud at the specified interval. For more information about best practices for incremental migration, see Migrate incremental data from a source server.
          • If you disable this feature, incremental data is not synchronized.
        • ECS Instance. The following table describes the parameters.
          Note The storage and operating systems of the source server and destination instance must be compatible. For more information, see Migrate servers to ECS instances.
          smc-instance
          Parameter Required Description
          Destination Instance No The destination ECS instance.
          License Type Yes The license type.
          Automatic Incremental Synchronization No Specifies whether SMC automatically synchronizes incremental data of the migration source to Alibaba Cloud.
          • To enable this feature, you must set the following parameters:
            • Synchronization Interval: the interval at which SMC automatically synchronizes incremental data to Alibaba Cloud.
            • Upperlimit of Reserved Images: the maximum number of images that can be retained during incremental migration.
            SMC automatically synchronizes incremental data to Alibaba Cloud at the specified interval. For more information about best practices for incremental migration, see Migrate incremental data from a source server.
          • If you disable this feature, incremental data is not synchronized.
        • Container Image. The following table describes the parameters.
          Note SMC does not allow you to migrate Windows servers to Container Registry. For more information, see Migrate source servers to Container Registry.
          Parameter Required Description
          Namespace Yes The namespace of the destination container image.
          Repository Name Yes The name of the repository that stores the destination container image.
          Version No The version of the destination container image.
          RAM Role Yes The RAM role that is attached to the intermediate instance.
      • Method to Run: specifies whether to run the task immediately after it is created or automatically run the task.
        • Run Now: The migration task runs immediately after it is created.
        • Run Later: The migration task automatically runs at the specified time after it is created.
          Note The earliest time that you can specify to run a migration task is 10 minutes after its creation.
        • Create Only: After the task is created, you must manually start the task.

        Default value: Run Now.

      Tag and Network (Optional):

      • Migration Task Tag: the tags that you specify for the migration task. Each tag contains a key and a value. You can use tags to query and manage migration tasks.
        Note You can specify a maximum of 20 tags for a migration task.
      • Network Type: the type of the network that is used to migrate data to an intermediate instance. During migration, SMC creates an intermediate instance that connects to a vSwitch in a VPC. If you select Public Network, a public IP address is assigned to the intermediate instance. 258

        The following table describes the parameters.

        Parameter Description
        Public Network SMC migrates data to the intermediate instance over the Internet. If you select Public Network, make sure that the migration source can access the Internet. You can choose whether to specify a VPC and a vSwitch based on your requirements.
        • If you specify a VPC and a vSwitch, SMC creates an intermediate instance that connects to the specified VPC and vSwitch.

          If you migrate multiple migration sources at a time, you can specify the same VPC and vSwitch for migration tasks. This improves the usage of VPC resources. You can migrate a maximum of 100 migration sources at a time.

        • If you do not specify a VPC or a vSwitch, SMC automatically creates a VPC and a vSwitch and creates an intermediate instance that connects to the VPC and the vSwitch.

          If you do not specify a VPC or a vSwitch before you migrate multiple migration sources at a time, SMC creates a VPC for each intermediate instance.

          Note Each Alibaba Cloud account can have a maximum of 10 VPCs in a region, including the VPCs that you create and the VPCs that are automatically created by SMC. Therefore, you can migrate a maximum of 10 migration sources at a time. To increase the VPC quota, submit a ticket.
        VPC SMC migrates data to the intermediate instance through a VPC. If you select VPC, you must specify a VPC and a vSwitch and make sure that the migration source can connect to the VPC.
        Note If your server in a data center, virtual machine, or cloud host can connect to a VPC, we recommend that you select this mode to migrate data. Compared with migration over the Internet, migration over a VPC is more efficient and stable. You can use VPN Gateway, Express Connect, and Smart Access Gateway to connect a migration source to a VPC. For more information, see Connect a data center to a VPC.
      Advanced Settings (Optional):
      • Checksum: This feature enhances the verification of data consistency between the migration source and the destination server. However, this may reduce the rate of data transmission.

        By default, this feature is disabled.

      • Transmission Speed Limit: the maximum bandwidth for data transmission during migration. Unit: Mbit/s.
      • Compression Level: the compression ratio of data to be migrated. Set the compression ratio based on your requirements.
        • If the bandwidth is limited, a high compression ratio improves the transmission efficiency.
        • If a high bandwidth is available, we recommend that you do not compress data. Data compression consumes CPU resources of the migration source.

        Valid values: 0 to 10. Default value: 7. The value 0 indicates that data is not compressed.

      • Intermediate Instance Type: The type of the intermediate instance. Select an intermediate instance type based on your needs. The parameter takes effect only when Resource Type is set to ECS Image or Container Image.
        • If you specify the parameter, SMC creates an intermediate instance based on the specified instance type. If the specified instance type is unavailable, you cannot create the migration task.
        • If you do not specify the parameter, SMC automatically creates an intermediate instance.
    4. After the configuration is completed, click OK.
  6. Start the migration task.
    Note If you set the Method to Run parameter to Run Now, skip this step. If you set the Method to Run parameter to Create Only or Run Later, you can perform the following steps to start the migration task:
    1. In the left-side navigation pane, click Migration Tasks.
    2. Find the migration task and click Start in the Actions column.
      • To start multiple migration tasks at a time, select the tasks and click Start/Retry in the lower part of the Migration Tasks page. The selected tasks must be in the Ready, Stopped, or Error state.
      • To suspend a migration task in the Syncing state, click Pause in the Actions column.

What to do next

After the migration is complete, perform the following steps based on the destination image type: