All Products
Search
Document Center

Server Migration Center:Migrate servers over a VPC

Last Updated:Nov 09, 2023

If your server can connect to a virtual private cloud (VPC) from your data center, VM, or cloud host, we recommend that you use Server Migration Center (SMC) to migrate the server over a VPC. Compared with migration over the Internet, migration over a VPC is more efficient and stable.

Scenarios

  • Scenario 1: Your server cannot access the Internet.

    Connect the server to a VPC by using VPN Gateway, Express Connect, or Smart Access Gateway, configure a proxy server, and then use the proxy server to access SMC.

  • Scenario 2: Your server can access the Internet and you can migrate the server over the Internet by using SMC. However, you want to increase the data transfer rate.

    Connect the server to a VPC by using VPN Gateway, Express Connect, or Smart Access Gateway. Then, create a migration job in the SMC console. When you create the migration job, specify VPC as the network type. Compared with migration over the Internet, migration over a VPC is more efficient.

Migration process

The following figure shows the process of migrating a server over a VPC.adasd566Migration process:

  1. Download the SMC client package and install the SMC client on the source server.

  2. Run the SMC client on the source server and use the proxy server to import the information about the source server to the SMC console. For more information about proxy servers, see the Forward proxies section in this topic.

  3. In the SMC console, create a migration job that uses VPC as the network type, and then start the job.

  4. SMC creates resources based on the migration job configurations and migrates data from the source server to Alibaba Cloud over a VPC.

  5. During the migration, the proxy server forwards instructions from the SMC console to the source server. For example, if an error occurs during the migration, SMC stops the migration and sends an error log to the SMC client. The proxy server receives this error log and forwards the error log to the SMC client on the source server.

Forward proxies

A forward proxy is a proxy server that is located between a client and a server. If the client cannot access the server over the Internet, a proxy server can be configured to communicate with the client and then send requests to the server. After the server receives the requests, it sends responses to the proxy server. Then, the proxy server sends the responses to the client.

A forward proxy has the following benefits:

  • Allows clients to access data resources on the Internet.

  • Caches Internet data that clients frequently access. When such data is accessed for the second time, the data can be directly retrieved from the cache. This increases the resource access efficiency for the clients.

  • Grants access permissions to clients and ensures data security on client computers.

  • Hides information about clients and stores access logs when clients access Internet resources.

Prerequisites

  • Your data center is connected to a VPC by using VPN Gateway, Express Connect, or Smart Access Gateway. For more information, see Connect a data center to a VPC.

  • Ports 8703 and 8080 are open on the firewall of your data center. This ensures that data can be transferred between the source server and the intermediate instance.

  • The source server can communicate with the proxy server over a network, and the proxy server can access the Internet.

Procedure

  1. Create a proxy server and enable port 3128.

    • (Recommended) Create an Alibaba Cloud Elastic Compute Service (ECS) instance. We recommend that you use an ECS instance that runs CentOS 7 or later. For more information, see Create an instance by using the wizard.

      By default, an ECS instance can access the internal endpoints of SMC. Verify that the following endpoints are accessible from the ECS instance that you created:

      • https://<region-id>.axt.aliyun.com, such as https://cn-hangzhou.axt.aliyun.com

      • https://smc.vpc-proxy.aliyuncs.com

    • Create a proxy server that is not on Alibaba Cloud.

      Make sure that the proxy server can access the following public endpoints of SMC:

      • https://smc-service.aliyuncs.com

      • https://smc.aliyuncs.com

  2. Install Squid on the proxy server.

    1. Use a remote connection tool to connect to the proxy server, such as WinSCP.

      In this example, the CentOS 7.9 operating system is used.

    2. Run the following commands to disable the firewall:

      systemctl stop firewalld
      setenforce 0
    3. Run the following command to install Squid:

      yum -y install squid
    4. Run the following command to open the Squid configuration file:

      vim /etc/squid/squid.conf
    5. Add the following configuration items to the configuration file:

      acl local src 0.0.0.0/24 # Allow all clients in the 0.0.0.0/24 CIDR block to access the server.
      http_access allow local # Allow local access. This line of code must be added before deny all.
      image.pngimage.png
      Important

      By default, Squid uses port 3128 as the HTTP listening port. If you need to change the port number, modify the http_port 3128 configuration item.

    6. After the configuration is complete, press the Esc key, enter :wq, and then press the ENTER key to save and close the configuration file.

    7. Run the following command to start Squid:

      systemctl start squid
      systemctl enable squid
  3. Import the information about the migration source.

    For more information, see Import the information about a migration source by using the SMC client.

    After you download and decompress the SMC client package, you must configure the proxy server information in the configuration file of your SMC client. Then, you can run the client to import the information about the source server to the SMC console. In the following example, Linux is used to show the procedure of configuring the proxy server information:

    1. In the go2aliyun_client directory, run the following commands to open the client_data file.

      In this example, an SMC client of the Linux 64-bit Generic Edition is used.

      cd go2aliyun_client_linux_x86_64
      vim client_data
    2. Find the proxy configuration item, as shown in the following figure.proxy

    3. Set the ip_port parameter to the IP address and port number of the proxy server.

      Example:

      "proxy": {
          "ip_port": "172.168.XX.XX:3128",
          "user_pwd": ""
      }

      After the configuration is complete, press the Esc key, enter :wq, and then press the ENTER key to save and close the configuration file.

  4. In the SMC console, create and start a migration job.

    For more information, see Create a server migration job. When you create a migration job, you must set the Network Type parameter to VPC, and specify a VPC and vSwitch. Make sure that the VPC is accessible from the source server over VPN Gateway, Express Connect, or Smart Access Gateway.

    image.png