Alibaba Cloud Real Name Account Purchase: How to Smoothly Migrate a Local Server to Alibaba Cloud ECS

cloud 2026-11-02 阅读 20
1

Migrating servers is like "changing tires for sports cars on the highway" for any operation and maintenance or architect-not only to ensure that the underlying data is word-for-word, but also to ensure that the upper-level business has as little downtime or even no sense of switching.

Many teams are prone to fall into two extremes when facing the "local IDC physical machine/virtual machine migration to the cloud": either think the migration is too simple and take it directly

rsync

Hard pull data, the result is because of environmental differences and authority problems lead to business anyway can't run up; Or think the process too complicated, vote for the mouse to pay attention to, slow to start construction.

Today's article combines the experience of "stepping on the pit" and "filling in the pit" of multiple real projects to sort out a complete set

Standardized Practical Guide for Smooth Migration of Local Servers to Alibaba Cloud ECS

.

Alibaba Cloud Real Name Account Purchase

Zero, the golden rule before migration: figure out your business type.

Before you start typing any line of command, stop and ask yourself one question:

Will my business accept downtime? For how long?

Different business tolerances determine completely different migration strategies:

Cold migration (offline migration): suspend local business-> package image/transfer data-> start target ECS. Ideal for internal tools, test environments, or downtime-insensitive businesses.

Hot migration (online smooth migration): business does not stop-> full data background synchronization-> incremental data real-time catch-up-> select a business low peak period to do DNS final second-level switch. This is the only option for the vast majority of online core businesses.

Alibaba Cloud Real Name Account Purchase

This article will focus on

Hot migration

As the main line, take you through the whole smooth migration process.

1. Preparation: Knife Grinding and Wood Cutting

80% of the reasons for migration failure are in the preparation stage. Please check the following items one by one before operation:

1. Target ECS architecture selection and planning

Computing and memory: Proportioning is based on the daily and peak CPU/memory utilization of the local server, and do not blindly purchase 1:1 according to the local physical machine configuration.

Network planning (VPC): In Alibaba Cloud, plan the network segments of the proprietary network (VPC) and the switch (VSwitch) in advance to ensure that there is no conflict with the network segments of the local IDC (especially when you need to pull a dedicated line or VPN connection later).

Disk space: The capacity of the system disk and data disk of the target ECS must be greater than or equal to the actual disk usage of the local source server (we recommend that you reserve more than 20% of the redundant space).

Bash

# Download the SMC client (take Linux 64-bit as an example)

wget https://smc-agent-optim-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/smc-agent.tar.gz

# Unzip and enter the directory

tar -zxvf smc-

agent.tar.gz

cd smc-agent

# Run the client and enter your AccessKey (AK/SK) or activation code to complete the binding

sudo ./go2aliyun_client

After the client is started, the local environment (disk space, kernel version, VirtIO driver, etc.) is detected. After the server is detected, the server is automatically displayed in the source server list in the Alibaba Cloud SMC console.

Step 3: Create and start the migration task (full synchronization)

Find the imported source server in the SMC console and click Create Migration Task.

Configure key parameters:

Target Mode: Select Generate Custom Image or Migrate to Target ECS Instance ". (It is recommended to select to generate an image first, and then create an instance after the test is correct, which has a higher safety factor).

Transmission mode: Public network or leased line/VPN is preferred. If using the public network, it is recommended to enable transmission encryption.

Disk mapping: Configure the corresponding relationship between the local disk and the Alibaba Cloud cloud disk, and modify the size of the target disk as needed.

Click Start, and the system will begin the first full data transfer.

💡Experience sharing: during the full transmission period, the local business does not need to stop at all and continues to provide normal external services. SMC silently synchronizes data blocks to the Alibaba Cloud temporary turntable in the background.

Step 4: Incremental Synchronization (Catch-Up Data)

Full synchronization time depends on your data size and network speed. After the full volume is completed, new data will inevitably be generated during the operation of the local business.

In the SMC console, locate the task and select Incremental Sync.

SMC compares the changes on the source side and the target side, and transmits only the new or modified files/data blocks during this period.

Alibaba Cloud real-name account purchase can be repeated two to three times before the official switch, the data gap is reduced to a minimum.

4. Cutover and pre-cutover "drill verification"

Many accidents of migration projects occur at the moment of "thinking that the migration is successful and directly cutting DNS. The correct approach is to conduct isolation drills. Purchase with an Alibaba Cloud real-name account

1. Business validation (drill)

Use the custom image generated by SMC to pull up a temporary ECS test machine in Aliyun VPC (note: do not bind public network IP for the time being, or only bind temporary EIP and do not expose it to the outside world).

Modify local hosts: In the hosts file of your development machine, point the domain name to the IP address of the temporary ECS instance.

Check core services:

Are the Nginx/Apache processes starting up properly?

Is the database/Redis connection working properly?

Is the disk mount path in /etc/fstab correct?

Check the system log (journalctl -xe or/var/log/messages) to see if any legacy local hardware driver reports an error.

After verification: Destroy test EC.

S.

2. Formal cutover (second/minute switching)

Select a business off-peak period (e. g. 2:00 a.m. on Saturday):

Service entry degradation/stop writing: Stop the services (such as database and user upload service) with frequent write operations on the local server, and hang up maintenance announcements to ensure that the source data is completely static.

Perform the last SMC incremental synchronization: Because no new data is written to the source at this time, this synchronization is usually completed within a few minutes.

Pull up the production ECS: Create the final production ECS based on the latest image, bind the elastic public network IP(EIP) or attach it to the Alibaba Cloud CLB/ALB load balancing.

Modify DNS resolution: Change the domain name resolution record (A record) from the public IP address of the local IDC to the Alibaba Cloud EIP/Server Load Balancer IP address.

Observe traffic transfer: Monitor the network traffic and logs of the old server and the new ECS to confirm that the traffic has completely transitioned to the cloud.

Guide to 5. Stepping on Pit and Avoiding Pit: Summary of Blood and Tears of Old Operation and Maintenance

Regarding changes to network interface names:

The local physical NIC may be called eth0, ens33, or em1, while the default NIC name of Alibaba Cloud ECS is usually eth0. If you find that you are not connected to the Internet after migration, the high probability is that the configuration in/etc/sysconfig/network-scripts/ifcfg-xxx or/etc/netplan/still contains the name of the old network card. Although SMC has automatic repair, it still needs to be checked in the drill stage.

Special handling for database migration:

For large databases (such as 500GB MySQL/PostgreSQL), we strongly recommend that you do not migrate them directly with the system disk. The best practice is:

System and application migration through SMC;

The database uses tools (such as Mysqldump Binlog increment, DTS or Percona XtraBackup) to synchronize the master and slave separately, and directly switches the master and slave during cutover.

Keep the old environment for 1-2 weeks:

After cutover is complete, do not immediately empty or shut down the local server! Keep the local environment still for 7 to 14 days to prevent quick rollback when hidden unknown bugs are found on the cloud. Purchase with an Alibaba Cloud real-name account

Conclusion

Migrating local servers to the cloud is not a simple "file copy", but a system engineering covering architecture evaluation, data synchronization, risk control, and business cutover. With the help of automation tools such as Alibaba Cloud SMC, we can transfer complex base conversion to the system and focus on business drills and data consistency verification.

If you push forward according to the plan, do enough test exercises, and leave a good way to roll back, you can realize the real "smooth cloud without feeling".

3
← 返回新闻中心