This topic describes how to migrate your instance within Alibaba Cloud ECS.

Background information

If you want to migrate your ECS instance within Alibaba Cloud ECS, we recommend that you consider image copy and image sharing features first. For more information, see Copy custom images and Share or unshare custom images. If these two features are not applicable, you can refer to the following scenarios:

Migrate your ECS instance within the current VPC

This scenario is applicable to disk shrinkage. For more information, see Decrease the size of a disk.

In this scenario, we recommend that you perform VPC-based migration for maximum efficiency. For more information, see VPC-based migration.

Migrate a Windows instance to another VPC

This method applies to scenarios where you want to migrate your Windows ECS instance across accounts, regions, or VPCs.

Preparations
  • Create snapshots to back up data.
  • Check the validity of your application licenses.

    When an ECS instance is migrated to another VPC, the underlying hardware devices of the system change and associated application licenses may become invalid.

  • Check the network environment.
    • When you migrate instances across regions outside China, the migration may be slow due to unstable network connections.
    • If your network can connect to VPCs, see VPC-based migration.
  • Make sure that the Windows VSS is enabled.
  • Check whether qemu-guest-agent is installed. If this tool is installed, you must uninstall it. For more information, see Cloud Migration tool FAQ.
  • We recommend that you use a test machine to conduct migration tests as described in this topic.

Procedure

  1. Download and install the Cloud Migration tool onto the server to be migrated.
    For more information, see the "Step 1: Download and install the Cloud Migration tool" section in Migrate your server to Alibaba Cloud by using the Cloud Migration tool.
  2. Configure the user_config.json file.

    The user_config.json file contains the following configuration items:

    • The AccessKey information of your Alibaba Cloud account.
    • The destination region of migration and the name of the destination image.
    • Optional. The size of the destination system disk and the specifications of the destination data disks.
    • The platform and architecture of the source system to be migrated.

    For information about how to configure these items, see the "Step 2: Configure the user_config.json file" section in Migrate your server to Alibaba Cloud by using the Cloud Migration tool.

  3. Optional:Configure the directories or files that do not need to be migrated.
    For more information, see the "Step 3: (Optional) Exclude files or directories from migration" section in Migrate your server to Alibaba Cloud by using the Cloud Migration tool.
  4. Run the main program of the Cloud Migration tool.

    Run go2aliyun_client.exe or go2aliyun_gui.exe as an administrator. If the main program is a GUI version, click Start to start the migration.

Migrate a Linux instance to another VPC

This method applies to scenarios where you want to migrate your Linux ECS instance across accounts, regions, or VPCs.

Preparations
  • Create snapshots to back up data.
  • Check the validity of your application licenses.

    When an ECS instance is migrated to another VPC, the underlying hardware devices of the system change and associated application licenses may become invalid.

  • Check the network environment.
    • When you migrate instances across regions outside China, the migration may be slow due to unstable network connections.
    • If your network can connect to VPCs, see VPC-based migration.
  • Download and install the Cloud Migration tool. For more information, see Download and install the Cloud Migration tool.
  • Go to the directory of the Cloud Migration tool and run the /Check/client_check --check command to check whether the instance to be migrated meets migration requirements.

    If all check items are displayed as OK in the command output, the server meets the migration requirements. Otherwise, you need to check GRUB.

    If operating systems of some instances have early kernel versions, such as CentOS 5, Red Hat 5, and Debian 7, you must upgrade GRUB to 1.99 and later. For more information, see Install GRUB in a Linux server.

    Note You must use the root account to upgrade GRUB.
  • We recommend that you use a test machine to conduct migration tests as described in this topic.

Procedure

  1. Configure the user_config.json file.

    The user_config.json file contains the following configuration items:

    • The AccessKey information of your Alibaba Cloud account.
    • The destination region of migration and the name of the destination image.
    • Optional. The size of the destination system disk and the specifications of the destination data disks.
    • The platform and architecture of the source system to be migrated.

    For information about how to configure these items, see the "Step 2: Configure the user_config.json file" section in Migrate your server to Alibaba Cloud by using the Cloud Migration tool.

  2. Optional:Configure the directories or files that do not need to be migrated.
    For more information, see the "Step 3: (Optional) Exclude files or directories from migration" section in Migrate your server to Alibaba Cloud by using the Cloud Migration tool.
  3. Run the following commands as the root user to grant the execution permission to the main program of the Cloud Migration tool and run the program:
    chmod +x go2aliyun_client
    ./go2aliyun_client
    Wait until the Cloud Migration tool finishes running. When the Goto Aliyun Finished! message is displayed, the migration is complete. The following figure shows an example.linux_result