edit-icon download-icon

Migrate to Alibaba Cloud by using Cloud Migration tool

Last Updated: May 03, 2018

Attention

To use Cloud Migration tool, consider the following:

  • Cloud Migration tool does not support migration of incremental data yet. You may select an off-peak period to suspend your on-premises server in which services that require data integration run.

  • During migration, an ECS instance named INSTANCE_FOR_GOTOALIYUN is created by default under your Alibaba Cloud account. It acts as an intermediate station.

    Note:

    • To avoid migration failure, do not stop, restart, or release the intermediate ECS instance. Moreover, the intermediate ECS instance is automatically released once the migration completes.
    • If the migration fails, the intermediate ECS instance is retained in the ECS for the next migration attempt. You can log on to the ECS console and manually release the instance to avoid unnecessary charges.
  • Billing method of the intermediate ECS instance is Pay-As-You-Go, you must make sure that no credit limit is set to your credit card and it allows the payment to go through.

  • After each successful migration, information about the intermediate ECS instance in the ECS is automatically recorded in the client_data configuration file. For the next migration, you must use the raw client configuration file that you have initially downloaded.

    Note:
    To avoid migration failure, in most cases, no manual modification for file client_data is required.

  • Migrating servers by using Cloud Migration tool requires your AccessKeyID and AccessKeySecret, which are important credentials, and you must keep them confidential and secured.

    Note:
    If the AccessKey that you create belongs to a RAM user, you must make sure that the specified RAM user is authorized to operate the ECS resources. For more information, see RAM document Authorization policies.

  • If shared memory is used in your on-premises server:

    • Default action:

      • For Windows servers: By default, Cloud Migration tool recognizes and uploads the data on a shared memory that is attached to the C drive as one part of the system disk.
      • For Linux servers: By default, Cloud Migration tool recognizes and uploads the data on a shared memory as one part of the system disk.
    • Custom action:

Prerequisites

Before you use the Cloud Migration tool, consider the following:

  • The on-premises server can access the Internet to transfer the data to Alibaba Cloud ECS, uninterruptedly. The Cloud Migration tool accesses the Alibaba Cloud services from the following endpoints:
  • The system time of the on-premises server is synchronized with the real time. Otherwise, an error indicating abnormal TimeStamp is recorded in the migration log file.

For on-premises servers running Windows OS

Run Cloud Migration tool as an administrator.

For on-premises servers running Linux OS

  • The go2aliyun_client program is not restricted by firewall on the server.

  • The Rsync library must have been pre-installed.

    • CentOS: Run yum install rsync –y.

    • Ubuntu: Run apt-get install rsync –y.

    • Debian: Run apt-get install rsync –y.

    • Other distributions: See the installation documents of the distributions on their official website.

  • The Xen or Kernel-based Virtual Machine (KVM) driver is installed. For more information about how to install a KVM driver, see Install virtio driver.

  • SELinux must be deactivated. You can temporarily deactivate SELinux by running setenforce 0. However, we recommend that you disable the SELinux for better experience by specifying the SELINUX=disabled in the /etc/selinux/config file.

  • Run Cloud Migration tool as a root user.

  • If the kernel of your on-premises Linux servers is too old and the version of GRUB (GRand Unified Bootloader) is earlier than 1.9. You may update the boot loader GRUB to a version later than 1.9.

  • To enable the entire server configuration successfully after the migration, we recommend that you install cloud-init for your on-premises servers.

Step 1. Download Cloud Migration tool

Download and decompress the Cloud Migration tool package accordingly. The list of files is as follows:

  • Windows server

    File or file folder Description
    Rsync file folder This folder contains all the applications required for a migration. Do not modify the files manually except for the filter file Rsync\etc\rsync_excludes_win.txt.
    client_data Maintains the record of transmission data during migration.
    user_config.json Configuration file of the on-premises server
    go2aliyun_client.exe Main program of Cloud Migration tool
  • Linux server

    File or file folder Description
    client_check Auxiliary program
    client_data Maintains the record of transmission data during a migration.
    user_config.json The configuration file of the on-premises server
    rsync_excludes_linux.txt This file filters out the directories from the migration.
    go2aliyun_client Main program of Cloud Migration tool

Step 2. Use Cloud Migration tool

  1. Log on to the server, virtual machine, or cloud host to be migrated.

  2. Decompress the Cloud Migration tool package to a specified directory.

  3. In the console, create an AccessKey, which is used in file user_config.json.

  4. Configure file user_config.json as needed.

  5. Filter out directories from migration as needed.

  6. Run Cloud Migration tool:

    • Windows server: Right-click go2aliyun_client.exe and select Run as administrator.
    • Linux server:
      1. Run chmod +x go2aliyun_client.
      2. Run ./go2aliyun_client.
  7. Wait for the results.

    • If Goto Aliyun Finished! is displayed, go to the Image page of the ECS console to check the results.
    • If Goto Aliyun Not Finished! is displayed, check the log files in the logs folder for troubleshooting. After the problem is rectified, run go2aliyun_client again, and it continues to proceed from where it was suspended during the preceding execution.

Customize user_config.json

The user_config.json configuration file is edited in JSON. The file contains necessary configuration information when you migrate the target on-premises server, including your AccessKey and target custom image. You must manually configure a few parameters. Make sure that the configuration complies with the JSON syntax. For more information about JSON syntax, see RFC 7159.

Template of user_config.json

The template for user_config.json is as follows:

  1. {
  2. "access_id": "",
  3. "secret_key": "",
  4. "region_id": "",
  5. "image_name": "",
  6. "system_disk_size": 40,
  7. "platform": "",
  8. "architecture": "",
  9. "data_disks": [],
  10. "bandwidth_limit":0
  11. }

Parameters in template

Table 1. Parameters for server configuration

Parameter name Type Required Description
access_id String Yes Your AccessKeyID for accessing Alibaba Cloud API. For more information, see Create an AccessKey.
secret_key String Yes Your AccessKeySecret for accessing Alibaba Cloud API. For more information, see Create an AccessKey.
region_id String Yes The ID of an Alibaba Cloud region to which your server is migrated, for example, cn-hangzhou (China East 1). For more information, see Regions and zones.
image_name String Yes Set a name for your server image, which must be different from the name of existing images in the same region of Alibaba Cloud.
  • The image name is a string of [2, 128] English letters.
  • It must start with an uppercase or lowercase English letter. It can contain numbers, periods (.), underscores (_), and hyphens (-).
  • The image name is displayed in the ECS console.
  • It cannot start with http:// or https://.
system_disk_size int Yes Specify the system disk size in the unit of GB. Value range:
  • [40, 500]
  • The value must be greater than the actual used space of the system disk on the on-premises server. For example, if the original system disk size is 500 GB and the used space is 100 GB, set this value greater than 100 GB.
platform String No Operating system of the on-premises server. Optional values:
  • CentOS
  • Ubuntu
  • SUSE
  • OpenSUSE
  • Debian
  • RedHat
  • Others Linux
  • Windows Server 2003
  • Windows Server 2008
  • Windows Server 2012
  • Windows Server 2016
The platform parameter is case-sensitive.
architecture String No Computer architecture. Optional values:
  • i386: 32-bit system architecture
  • x86_64: 64-bit system architecture
bandwidth_limit int No The maximum bandwidth of data transmission, in the units of measurement KB/s.
The default value is 0, and 0 indicates no limit for the bandwidth.
data_disks Array No List of data disks in your on-premises server. A maximum of 16 data disks are supported. For more information about specific parameters, see Parameters for data disk configuration.

Table 2. Parameters for data disk configuration

Parameter name Type Manually set Description
data_disk_index int Yes Data disk number. Value range: [1, 16]
Default value: 1
data_disk_size int Yes Data disk size. Unit: GB. Value range:
  • [5, 2000]
  • The value must be greater than the actual used space of the data disk on the on-premises server. For example, if the original data disk size is 500 GB and the used space is 100 GB, set this value to be greater than 100 GB.
src_path String Yes The directory of a data disk. Optional values:
  • In Windows, specify a drive letter, for example, D:, E:, or F:.
  • In Linux, specify a path, for example, /mnt/disk1, mnt/disk2, or /mnt/disk3.
    Note: It cannot be the /root directory or system directories, such as /bin, /boot, /dev, /etc, /lib, /lib64, /sbin, /usr or /var.
After you migrate an on-premises Linux server, the data disks are not mounted by default. You can run the command ls /dev/vd* to view the data disk devices. You may mount the data disks manually as needed, and edit configuration file /etc/fstab to configure the mounting file systems. For more information, see Linux_Format and mount a data disk.

Examples of custom configuration

The following describes how to customize user_config.json based on the configuration file templates according to four scenarios:

Scenario 1. Migrate a Windows server without data disk

  • Assume that the configuration of your server is as follows:
    • Operating system: Windows Server 2008
    • Used space of system disk: 30 GB
    • Computer architecture: 64-bit
  • Migration destination:
    • Target migration region: Alibaba Cloud China East 1 region (cn-hangzhou)
    • Image name: CLIENT_IMAGE_WIN08_01
    • Size of system disk: 50 GB

You can configure the file user_config.json based on the following information:

  1. {
  2. "access_id": "YourAccessKeyID",
  3. "secret_key": "YourAccessKeySecret",
  4. "region_id": "cn-hangzhou",
  5. "image_name": "CLIENT_IMAGE_WIN08_01",
  6. "system_disk_size": 50,
  7. "platform": "Windows Server 2008",
  8. "architecture": "x86_64",
  9. "data_disks": [],
  10. "bandwidth_limit":0
  11. }

Scenario 2. Migrate a Windows server with data disks

Assume that the three data disks are attached to the Windows server in Scenario 1. The drive letter and sizes of the data disks are as follows:

  • D: 100 GB
  • E: 150 GB
  • F: 200 GB

You can configure the user_config.json file based on the following information:

  1. {
  2. "access_id": "YourAccessKeyID",
  3. "secret_key": "YourAccessKeySecret",
  4. "region_id": "cn-hangzhou",
  5. "image_name": "CLIENT_IMAGE_WIN08_01",
  6. "system_disk_size": 50,
  7. "platform": "Windows Server 2008",
  8. "architecture": "x86_64",
  9. "data_disks": [ {
  10. "data_disk_index": 1,
  11. "data_disk_size": 100,
  12. "src_path": "D:"
  13. }, {
  14. "data_disk_index": 2,
  15. "data_disk_size": 150,
  16. "src_path": "E:"
  17. }, {
  18. "data_disk_index": 3,
  19. "data_disk_size": 200,
  20. "src_path": "F:"
  21. }
  22. ],
  23. "bandwidth_limit":0
  24. }

Scenario 3. Migrate a Linux server without data disk

  • Assume that the configuration of your server is as follows:
    • Version: CentOS 7.2
    • Used space of system disk: 30 GB
    • Computer architecture: 64-bit
  • Migration destination:
    • Target migration region: Alibaba Cloud China East 1 region (cn-hangzhou)
    • Image name: CLIENT_IMAGE_CENTOS72_01
    • Size of system disk: 50 GB

You can configure the user_config.json file based on the following information:

  1. {
  2. "access_id": "YourAccessKeyID",
  3. "secret_key": "YourAccessKeySecret",
  4. "region_id": "cn-hangzhou",
  5. "image_name": "CLIENT_IMAGE_CENTOS72_01",
  6. "system_disk_size": 50,
  7. "platform": "CentOS",
  8. "architecture": "x86_64",
  9. "data_disks": [],
  10. "bandwidth_limit":0
  11. }

Scenario 4. Migrate a Linux server with data disks

Assume that the three data disks are attached to the Linux server in Scenario 3. The drive letter and sizes of the data disks are as follows:

  • /mnt/disk1: 100 GB
  • /mnt/disk2: 150 GB
  • /mnt/disk3: 300 GB

You can configure the user_config.json file based on the following information:

  1. {
  2. "access_id": "YourAccessKeyID",
  3. "secret_key": "YourAccessKeySecret",
  4. "region_id": "cn-hangzhou",
  5. "image_name": "CLIENT_IMAGE_CENTOS72_01",
  6. "system_disk_size": 50,
  7. "platform": "CentOS",
  8. "architecture": "x86_64",
  9. "data_disks": [ {
  10. "data_disk_index": 1,
  11. "data_disk_size": 100,
  12. "src_path": "/mnt/disk1"
  13. }, {
  14. "data_disk_index": 2,
  15. "data_disk_size": 150,
  16. "src_path": "/mnt/disk2"
  17. }, {
  18. "data_disk_index": 3,
  19. "data_disk_size": 200,
  20. "src_path": "/mnt/disk3"
  21. }
  22. ],
  23. "bandwidth_limit":0
  24. }

Filter out directories from migration

Cloud Migration tool can be used to filter out files or directories that are not migrated to Alibaba Cloud.

You can configure rsync to filter out files and directories from migrating to Alibaba Cloud. On a Linux server, the filtering function is implemented by configuring the rsync_excludes_linux.txt text file. On a Windows server, the filtering function is implemented by configuring the Rsync/etc/rsync_excludes_win.txt text file. For how to add files and directories to be filtered out in the .txt file, see Documents related to rsync.

Samples: For example, if you want to migrate the folder C:\MyDirs\Docs\Words and file C:\MyDirs\Docs\Excels\Report1.xlsx on a Windows server. You can write the configuration in the file Rsync/etc/rsync_excludes_win.txt as follows:

  1. /MyDirs/Docs/Words/
  2. /MyDirs/Docs/Excels/Report1.xlsx

The following are the default files to be filtered out.

  • Windows servers:
    • pagefile.sys
    • $RECYCLE.BIN
    • System Volume Information
  • Linux servers:
    • /dev/*
    • /sys/*
    • /proc/*
    • /media/*
    • /lost+found/*
    • /mnt/*
    • /var/lib/lxcfs/*

      Note:

      • Directory /var/lib/lxcfs/* is only applicable to some versions. For example, when you do not have the access permission on the cache directory for Linux containers of Ubuntu, /var/lib/lxcfs/* must be filtered out before migration.
      • Cloud migration is a time-consuming task, and we recommend that you filter out the unnecessary directories on the data disks to be migrated. At the same time, the used storage space of cloud disks after the migration is reduced.

Troubleshooting

Log records of Cloud Migration tool are stored in the Logs directory under the main program directory. Abnormal interruptions during migration are recorded in log files. When Goto Aliyun Not Finished is displayed, you can check the log for troubleshooting.

Image test

After migration, the resource of your on-premises server, such as the operating system, applications, and application data, are displayed as a custom image in the Image page of the ECS console. You can create a Pay-As-You-Go instance by using the custom image to test whether the custom image works or not.

Next step

Thank you! We've received your feedback.