This topic describes how to migrate your source server to Alibaba Cloud by using the Cloud Migration tool. Source servers can be IDC servers, virtual machines (VMs), cloud hosts on other platforms, or other types of servers that you want to migrate.

Prerequisites

Note The Cloud Migration tool is upgraded to Server Migration Center (SMC). Alibaba Cloud no longer provides version updates and technical support for the Cloud Migration tool. We recommend that you use SMC for a better cloud migration experience. SMC provides a variety of features such as full migration, incremental migration, batch migration, and VPC-connected migration. It also provides a web-based SMC console for interactive operations. For more information, see What is SMC?
Before you use the Cloud Migration tool, make sure that the following conditions are met:
  • An Alibaba Cloud account is created and the corresponding permissions are granted.
    1. Create an account on the Alibaba Cloud official website. To migrate servers to regions within mainland China, you must complete real-name verification.
    2. Make sure you have sufficient balance in your linked credit card.
      Notice The Cloud Migration tool is provided for free. However, you will be charged for pay-as-you-go resources that are created during migration.
    3. If you are using a RAM user, contact the Alibaba Cloud account owner to grant read and write permissions on ECS and VPC resources to the RAM user. We recommend that permissions specified in AliyunECSFullAccess and AliyunVPCFullAccess policies be granted to the RAM user. For more information, see Implement access control by using RAM.
    4. Activate the snapshot service in the ECS console.
    5. If you are using a service provider account, make sure that you can call API operations to create orders and purchase resources.
  • The source server environment is prepared.
    1. Make sure that the time of the source server is the same as the actual time to avoid the IllegalTimestamp error.
    2. Make sure that the source server can access the following ports of endpoints:
      • ECS: https://ecs.aliyuncs.com 443. For the endpoints of ECS in other regions, see the "Service endpoints" section in Request structure.
      • VPC: http://vpc.aliyuncs.com 443.
      • STS: https://sts.aliyuncs.com 443.
      • Intermediate instance: ports 8080 and 8703 corresponding to public IP addresses. To perform a VPC-based migration, you must access the private IP address of the intermediate instance. For more information, see Migrate services to the cloud by using Alibaba Cloud VPC.
    3. If your source server runs a Linux operating system:
      1. Make sure that the rsync library is installed. If not, run one of the following commands that corresponds to your operating system to install the library:
        • CentOS: Run the yum -y install rsync command.
        • Ubuntu: Run the apt-get -y install rsync command.
        • Debian: Run the apt-get -y install rsync command.
        • SUSE: Run the zypper install rsync command.
        • Other system release versions: See the installation documentation on their official websites.
        Note Typically, the rsync library is installed on servers that run mainstream operating systems. You do not need to manually install it.
      2. Make sure that SELinux is disabled on the source server. If not, you can run the setenforce 0 command to temporarily disable SELinux. You can also modify the /etc/selinux/config file to set SELINUX to disabled.
        Note Typically, SELinux is enabled only on servers that run CentOS and Red Hat operating systems.
      3. Make sure that the KVM virtio driver is installed. For more information, see Install virtio driver.
        Note Typically, the KVM virtio driver is installed on servers that run mainstream operating systems. You do not need to manually install it.
      4. Make sure that a later version of GRUB is installed. For earlier versions of operating systems such as CentOS 5, Red Hat 5, and Debian 7, you must use GRUB 1.9 or later. For more information, see Install GRUB in a Linux server.
        Note For some operating systems such as Amazon Linux, you must use GRUB 2.02 or later.

Background information

If you only need to migrate databases, we recommend that you use Data Transmission Service (DTS). For more information, see Data migration.

To improve the success rate of migration, read the following precautions:
  • Do not perform operations on the intermediate instance.
    During each migration, an intermediate instance named INSTANCE_FOR_GOTOALIYUN or No_Delete_GotoAliyun_Transition_Instance is created to assist the migration. To avoid migration failures, do not manually stop, restart, or release the intermediate instance. After the migration is complete, the intermediate instance will be automatically released.
    Note If the Cloud Migration tool V1.5.0 or later is used, the intermediate instance is named No_Delete_GotoAliyun_Transition_Instance.
  • The following content lists default directories of data migration:
    • For Windows servers: Only data on the C drive (including shared directories attached to the C drive) is migrated as a partition of the system disk. For information about migration of other partitions such as the D drive, see the Data disk configurations section.
    • For Linux servers: Data on all subdirectories (including shared directories) in the root directory (/) is migrated as a partition of the system disk. For information about migration of other subdirectories such as /disk1, see the Data disk configurations section.

Procedure

Perform the following operations to migrate a server to Alibaba Cloud:

  1. Step 1. Download and install the Cloud Migration tool
  2. Step 2. Configure the migration source and destination
  3. Step 3 (optional): Exclude files or directories from migration
  4. Step 4. Run the Cloud Migration tool

Step 1. Download and install the Cloud Migration tool

Click here to download the Cloud Migration tool package and decompress the package to the source server. The Cloud Migration tool is available for Windows and Linux in the 32-bit version (i386) and the 64-bit version (x86_64). Select a client version based on the operating system of the source server.

Figure 1. Versions
Table 1. Main files
File or folder Description
go2aliyun_client.exe The Windows CLI executable file.
go2aliyun_gui.exe The Windows GUI executable file. For more information, see Windows GUI of Cloud Migration tool.
go2aliyun_client The Linux CLI executable file.
user_config.json The configuration file of the migration source and destination.
Excludes The configuration folder for files and directories that are excluded from migration.
client_data The migration data file, which includes the intermediate instance information and migration progress.

Step 2. Configure the migration source and destination

Open the user_config.json file in the directory and modify the file based on the Server parameters and Data disk parameters tables. The following content shows the initial status of the file:
{
    "access_id": "",
    "secret_key": "",
    "region_id": "",
    "image_name": "",
    "system_disk_size": 40,
    "platform": "",
    "architecture": "",
    "bandwidth_limit":0,
    "data_disks": []
}
Note If you are using the Windows GUI executable file, you can configure the user_config file on the GUI. For more information, see Windows GUI of Cloud Migration tool.
Table 2. Server parameters
Parameter Type Required Description
access_id String Yes The ID of the AccessKey pair used by your Alibaba Cloud account to submit an API request. For more information, see Create an AccessKey pair.
Note AccessKey pairs are important credentials. You must keep them safe. To prevent your AccessKey pair from being exposed or misused, we recommend that you use a RAM user to create a temporary AccessKey pair, and then disable the AccessKey pair after the migration is complete.
secret_key String Yes The AccessKey secret used by your Alibaba Cloud account to submit an API request. For more information, see Create an AccessKey pair.
region_id String Yes The ID of the region to which the source server is migrated, such as cn-hangzhou. For more information, see Regions and zones.
image_name String Yes The image name configured for the source server. The name must be unique in a region. The name is must be 2 to 128 characters in length and can contain letters, numbers, Chinese characters, periods (.), colons (:), underscores (_), and hyphens (-). It must start with a letter or a Chinese character.
system_disk_size Integer Yes The size of the system disk. Unit: GiB. Valid values: 40 to 500.
Note The parameter value must be greater than the actual used space of the system disk on the source server. For example, if the size of the source disk is 500 GiB but the actual used space is only 100 GiB, you only need to set this parameter to a value greater than 100.
platform String No The operating system of the source server. Valid values: Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows Server 2016, CentOS, Ubuntu, SUSE, openSUSE, Debian, Red Hat, and Others Linux.
Note The value of the platform parameter must be case-sensitive and among the preceding list.
architecture String No The system architecture. Valid values: i386 and x86_64.
Note The architecture parameter is not provided by the Cloud Migration tool V1.5.0 and later.
bandwidth_limit Integer No The bandwidth limit of data transmission. Unit: KB/s.

The default value is 0, which indicates unlimited bandwidth.

data_disks Array No The list of data disks. You can specify a maximum of 16 data disks. For more information, see the following Data disk parameters table. You can set this parameter to the expected data disk size in GiB. The parameter value cannot be smaller than the actual used space of the data disk.
Table 3. Data disk parameters
Parameter Type Required Description
data_disk_index Integer Yes The serial number of the data disk. Valid values: 1 to 16.

By default, the parameter value starts from 1.

data_disk_size Integer Yes The size of the data disk. Unit: GiB. Valid values: 20 to 32768.
Note The parameter value must be greater than the actual used space of the data disk on the source server. For example, if the size of the source disk is 500 GiB but the actual used space is only 100 GiB, you only need to set this parameter to a value greater than 100.
src_path String Yes The source directory of the data disk. Examples:
  • In Windows, specify a drive letter, such as D, E, or F.
  • In Linux, specify a directory, such as /mnt/disk1, mnt/disk2, or /mnt/disk3.
    Note Source directories cannot be configured as root directories or system directories, such as /bin, /boot, /dev, /etc, /lib, /lib64, /sbin, /usr, and /var.
The following section lists examples about how to modify the user_config.json file based on different scenarios:
  • Scenario 1: Migrate a Windows server without data disks to the China (Hangzhou) region
    • Source server configuration:
      • Operating system: Windows Server 2008
      • System architecture: 64-bit
      • System disk size: 30 GiB
    • Destination server configuration:
      • Target region: China (Hangzhou) (cn-hangzhou)
      • Image name: CLIENT_IMAGE_WIN08_01
      • System disk size: 50 GiB
    {
        "access_id": "YourAccessKeyID",
        "secret_key": "YourAccessKeySecret",
        "region_id": "cn-hangzhou",
        "image_name": "CLIENT_IMAGE_WIN08_01",
        "system_disk_size": 50,
        "platform": "Windows Server 2008",
        "architecture": "x86_64",
        "data_disks": [],
        "bandwidth_limit": 0
    }
  • Scenario 2: Migrate a Windows server with data disks to the China (Hangzhou) region
    In this scenario, the Windows server from Scenario 1 has two data disks attached. The following content lists directories and sizes of the data disks:
    • Sizes of source data disks:
      • D: 50 GiB
      • E: 100 GiB
    • Sizes of destination data disks:
      • D: 100 GiB
      • E: 150 GiB
    {
        "access_id": "YourAccessKeyID",
        "secret_key": "YourAccessKeySecret",
        "region_id": "cn-hangzhou",
        "image_name": "CLIENT_IMAGE_WIN08_01",
        "system_disk_size": 50,
        "platform": "Windows Server 2008",
        "architecture": "x86_64",
        "data_disks":  [ {
                "data_disk_index": 1,
                "data_disk_size": 100,
                "src_path": "D:"
            }, {
                "data_disk_index": 2,
                "data_disk_size": 150,
                "src_path": "E:"
            }
        ],
        "bandwidth_limit": 0
    }
  • Scenario 3: Migrate a Linux server without data disks to the China (Hangzhou) region
    • Source server configuration:
      • Operating system: CentOS 7.2
      • System architecture: 64-bit
      • System disk size: 30 GiB
    • Destination server configuration:
      • Target region: China (Hangzhou) (cn-hangzhou)
      • Image name: CLIENT_IMAGE_CENTOS72_01
      • System disk size: 50 GiB
    {
        "access_id": "YourAccessKeyID",
        "secret_key": "YourAccessKeySecret",
        "region_id": "cn-hangzhou",
        "image_name": "CLIENT_IMAGE_CENTOS72_01",
        "system_disk_size": 50,
        "platform": "CentOS",
        "architecture": "x86_64",
        "data_disks": [],
        "bandwidth_limit": 0
    }
  • Scenario 4: Migrate a Linux server with data disks to the China (Hangzhou) region
    In this scenario, the Linux server from Scenario 3 has two data disks attached. The following content lists directories and sizes of the data disks:
    • Sizes of source data disks:
      • /mnt/disk1: 50 GiB
      • /mnt/disk2: 100 GiB
    • Sizes of destination data disks:
      • /mnt/disk1: 100 GiB
      • /mnt/disk2: 150 GiB
    {
        "access_id": "YourAccessKeyID",
        "secret_key": "YourAccessKeySecret",
        "region_id": "cn-hangzhou",
        "image_name": "CLIENT_IMAGE_CENTOS72_01",
        "system_disk_size": 50,
        "platform": "CentOS",
        "architecture": "x86_64",
        "data_disks":  [ {
                "data_disk_index": 1,
                "data_disk_size": 100,
                "src_path": "/mnt/disk1"
            }, {
                "data_disk_index": 2,
                "data_disk_size": 150,
                "src_path": "/mnt/disk2"
            }
        ],
        "bandwidth_limit": 0
    }

Step 3 (optional): Exclude files or directories from migration

The following configuration files are located in the Excludes directory of the tool:
  • Configuration file of the system disk: rsync_excludes_win.txt or rsync_excludes_linux.txt.
  • Configuration file of the data disks: named by adding a suffix disk [disk index number] to the system disk files, such as rsync_excludes_win_disk1.txt (for Windows servers) or rsync_excludes_linux_disk1.txt (for Linux servers).
Note If the corresponding configuration file is missing or accidentally deleted, you can create one.
  • Example 1: Exclude files or directories from migration of a Windows server
    • System disk:
      • Specify the file or directory to be excluded:
        C:\MyDirs\Docs\Words
        C:\MyDirs\Docs\Excels\Report1.xlsx
      • Add the following information to the rsync_excludes_win.txt file:
        /MyDirs/Docs/Words/
        /MyDirs/Docs/Excels/Report1.xlsx
    • Data disk:
      • Specify the file or directory to be excluded:
        D:\MyDirs2\Docs2\Words2
        D:\MyDirs2\Docs2\Excels\Report2.xlsxx
      • Add the following information to the rsync_excludes_win_disk1.txt file:
        /MyDirs2/Docs2/Words2/
        /MyDirs2/Docs2/Excels2/Report2.xlsx
      Note To exclude a Windows path, you must remove the prefix of the path (scr_path). In the preceding example, you must remove D:\.
  • Example 2: Exclude files or directories from migration of a Linux server
    • System disk (root directory/):
      • Specify the file or directory to be excluded:
        /var/mydirs/docs/words
        /var/mydirs/docs/excels/report1.shx
      • Add the following information to the rsync_excludes_linux.txt file:
        /var/mydirs/docs/words/
        /var/mydirs/docs/excels/report1.sh
    • Data disk:
      • Specify the file or directory to be excluded:
        /mnt/disk1/mydirs2/docs2/words2
        /mnt/disk1/mydirs2/docs2/excels2/report2.shx
      • Add the following information to the rsync_excludes_linux_disk1.txt file:
        /mydirs2/docs2/words2/
        /mydirs2/docs2/excels2/report2.sh
      Note To exclude a Linux path, you must remove the prefix of the path (scr_path). In the preceding example, you must remove /mnt/disk1.

Step 4. Run the Cloud Migration tool

Perform one of the following operations to run the Cloud Migration tool on a Windows or Linux server:
  • Windows:
    • Run the go2aliyun_gui.exe executable file under the tool directory. For more information, see Windows GUI of Cloud Migration tool.
    • Alternatively, run the go2aliyun_client.exe executable file.
    Note When you run the program, you must confirm your administrator privileges by clicking OK.
  • Linux:
    • Run the following commands in the tool directory by using the root account:
      chmod +x ./go2aliyun_client
      ./go2aliyun_client
    • The sudo permission is required for running the following commands as a non-root user:
      sudo chmod +x ./go2aliyun_client
      sudo ./go2aliyun_client
    Note After you run the Cloud Migration tool, wait until the migration is complete.

After you run the Cloud Migration tool, it will obtain the number of vCPUs, size of memory and disks, and the utilization of vCPUs, usage of memory and disks, and shows the information on the user interface. The migration status is also displayed on the user interface as a log stream.

Next step after a successful migration

If the Goto Aliyun Finished! message appears as shown in the following figure, the migration is complete.
Figure 2. Migration succeeds

Perform the following operations:

  1. Log on to the ECS console, go to the Images page, and then select the target region to view the generated custom image.
  2. Use the custom image to create a pay-as-you-go instance or replace the system disk of an instance to check whether the custom image runs properly. For more information, see Create an ECS instance by using a custom image and Replace the system disk (non-public images).
    Note To replace the system disk of an instance, you must use a custom image without data disks.
  3. Before you start the destination instance for the first time, you must check the system. For detailed operations, see the After I migrate a Windows server, how do I perform checks on my system? and After I migrate a Linux server, how do I perform checks on my system? sections in Cloud Migration tool FAQ.

Next step after a failed migration

If the Goto Aliyun Not Finished! message appears as shown in the following figure, the migration could not be completed due to an exception.
Figure 3. Migration fails

Perform the following operations:

  1. Check error messages of files in the Logs folder. For information about how to fix the issues, see Troubleshooting and Cloud Migration tool FAQ.
  2. Run the Cloud Migration tool again and the tool will continue the execution progress from where it left off.
    Note If the intermediate instance is released, a new migration is required. For more information, see the What do I do if I released an intermediate instance by mistake? and When do I need to clear the client_data file? sections in Cloud Migration tool FAQ.

Contact us

If you have any questions, suggestions, or needs about the Cloud Migration tool, contact us. For more information, see Feedback and support.