If you can directly access a VPC from your on-premises IDC, virtual machine, or cloud host, but want to fully migrate your services to Alibaba Cloud, you can connect your source server with your target VPC to easily migrate your services. Compared with migrating your cloud services through the Internet, migrating your cloud services using Alibaba Cloud VPC transfers data at faster speeds and with greater stability.

You can use Express Connect or VPN to connect to the target VPC, and then use the Cloud Migration tool to perform a VPC-based migration.

Background information

The Cloud Migration tool v1.2.8 and later versions support VPC-based migration. To perform a VPC-based migration, you need to set the net_mode field of client_data to 1 or 2.



The options of the net_mode parameter are described as follows:
  • 0: the default value, which indicates Internet-based migration. The system to be migrated must support data transfer through the Internet.
  • 1: indicates that the system to be migrated can access the specified VPC. The migration process is divided into phase 1, phase 2, and phase 3. In phase 2, data is transferred in the current system. In phase 1 and phase 3, data is transferred in other Internet environments.
  • 2: indicates that the system to be migrated can access the Internet and the specified VPC. Data is transferred through the specified VPC.

Different parameter settings apply to different migration methods.

Method 1

If you set net_mode to 1, follow these steps to migrate the system:

  1. Create an intermediate instance in the Internet environment.

    1. Log on to the target system (system A, in this example) that has access to the Internet, and then download the Cloud Migration tool. For more information, see Migrate your server to Alibaba Cloud by using the Cloud Migration tool.
    2. Configure the user_config.json file.
    3. Set the target vpc_id and vswitch_id in the client_data file. For more information, see Configure the client_data file to the specified VPC.
    4. Run the Cloud Migration tool until the message Stage 1 is done! is displayed.

  2. Transfer system data in the VPC.

    1. Log on to the system to be migrated to the VPC (system B, in this example).
    2. Copy the Cloud Migration tool from system A to system B.
      Note The user_config.json file and the client_data file in system B must be the same as those in the Cloud Migration tool in system A.
    3. Run the Cloud Migration tool until the message Stage 2 is done! is displayed.

  3. Create an image in the Internet environment.

    1. Go back to system A, and then copy the Cloud Migration tool from system B to system A.
      Note The user_config.json file and the client_data file must be the same as those in the Cloud Migration tool in system A.
    2. Run the Cloud Migration tool until the message Stage 3 is done! is displayed, which indicates the cloud migration is finished.

Method 2

If you set net_mode to 2, follow these steps to migrate the system:

  1. Log on to the system to be migrated, and then download the Cloud Migration tool. For more information, see Migrate your server to Alibaba Cloud by using the Cloud Migration tool.
  2. Configure the user_config.json file.
  3. Set the target vpc_id and vswitch_id in the client_data file. For more information, see Configure the client_data file to the specified VPC.
  4. Run the Cloud Migration tool until the migration is completed.
Note During the migration, data is transferred through the VPC in the data migration phase, or through the Internet in other phases.

Configure the client_data file.

To configure the client_data file to the specified VPC, follow these steps:

  1. Set vpc_id to the ID of the specified VPC.



  2. Set vswitch_id to the ID of the specified VSwitch.



  3. (Optional) Set security_group_id to the ID of the specified security group. If you do not set this parameter, it will be automatically created.

    Note The specified security group must enable port 8080 and port 8703 in the inbound direction.