Migrating Tencent Cloud CVM Data Across Availability Zones

Last updated: 2019-12-06 11:40:49


Cross-region data migration means to move the data on a CVM in an availability zone in one region to a destination CVM in an availability zone of another region. It can also means to move data between CVMs in different availability zones within the same region.

Obtaining the Migration Tool

Click here to obtain the compressed migration tool package.

Choosing a Migration Mode Based on the Network Environment

Choose the appropriate migration mode according to the network environments of your source servers and destination CVMs.
Currently, the migration tool supports the default mode and the private network mode. The private network mode applies to three scenarios. Each migration mode or scenario has different network requirements for source servers and destination CVMs. If both source servers and destination CVMs can access the public network, you can use the default mode for migration. If either source servers or destination CVMs cannot access the public network directly, you need to establish connections through VPN Connection, Cloud Connect Network ,or Direct Connect before using the private network mode for migration.

Data Backup

You can back up your data by creating snapshots.

Checking Before Migrating

Before migrating, check the following items for source servers and destination CVMs respectively:

Destination CVM
  1. Storage: The cloud disks of the destination CVM, including system disks and data disks. Verify that they have sufficient storage to store the data from the source server.
  2. Security group: Ports 443 and 80 must be open in a security group.
  3. Bandwidth setting: We recommend that you increase bandwidth for faster migration. The traffic consumed during migration will be approximately equal to the data volume. Change your networking billing method in advance if needed.
  4. Operating system: We recommend that the destination CVM and the source server use the same operating system. Different operating systems will lead to inconsistency between the image that will be made later and the actual operating system. For example, when migrating a source server with the CentOS 7 system installed, choose a CVM with the CentOS 7 system installed as the migration destination.
Linux source server
  1. Check for and install Virtio. For more information, see Checking Virtio Drivers in Linux.
  2. Check whether rsync and grub2-install (or grub-install) are installed.
  3. Check whether SELinux is enabled. Disable SELinux if it is enabled.
  4. When a migration request is sent to Tencent Cloud API, the latter uses the current UNIX time to check against the generated token. In this case, ensure that the current system time is correct.
  • You can use tool commands to automate the checking of source servers, for example, sudo ./go2tencentcloud_x64 --check.
  • By default, the go2tencentcloud migration tool automatically performs checking when it starts to run. If you want to skip the check and force migration, set the value of the Client.Extra.IgnoreCheck field in the client.json file to true.

Start Migration

  1. (Optional) Establish a connection between the source server and the destination CVM.
  2. Configure the user.json file.
    The user.json file is for configuring the source server and the target CVM. It contains the following configuration items:
    • The access key pair of your account API, that is, SecretId and SecretKey. For more information, see Access Keys.
    • The region and instance ID of the target CVM.
    • (Optional) The data disk configuration of the source server.
  3. Configure the client.json file.
    The client.json file is for configuring the migration mode and other migration configuration items. You need to set the Client.Net.Mode parameter in the client.json file for any migration mode or scenario.
  4. (Optional) Remove files and directories on the server that do not need to be migrated.
    Edit the rsync_excludes_linux.txt file on the Linux source server to remove files and directories that do not need to be migrated.
  5. Run the tool.
    For example, on a 64-bit Linux source server, run the following command with root permissions to run the tool.
    sudo ./go2tencentcloud_x64
    For example, you are using the private network mode: scenario 2 for migration. If the migration is successful, the following console output appears: