If your operating system enters the end of life (EOL) phase or to migrate to a different version to meet business requirements, you can use Server Migration Center (SMC) to migrate the operating system while retaining the data on the system disk of the ECS instance. This topic describes how to use SMC to migrate CentOS 7/8, Red Hat 7/8, and Alibaba Cloud Linux 2.
Only specific users can use SMC to migrate a CentOS 7 or CentOS 8 operating system to Red Hat 7 or Red Hat 8. To use this feature, you can submit a ticket to request access.
Background information
When the operating system of your ECS instance enters the end of life (EOL) phase, as described in Overview of operating system lifecycles, you may face increased security and operational risks. We recommend that you replace the operating system as soon as possible. The operating system migration feature of Server Migration Center (SMC) provides several migration solutions. After the migration, the operating system kernel and major system packages are upgraded, while the data on the system disk is retained.
If you do not need to retain data on the system disk or if you require more operating system conversion options, you can replace the operating system. For more information, see Replace the system disk.
Migration solutions
CentOS 7/8
Operating system architecture | Source operating system | Destination operating system |
x86 | CentOS 7.x |
|
CentOS 8.x |
| |
ARM64 | CentOS 7.x |
|
CentOS 8.x |
|
Red Hat 7/8
Operating system architecture | Source operating system | Destination operating system |
x86 | Red Hat 7.9 |
|
Red Hat 8.x |
|
Alibaba Cloud Linux 2
Operating system architecture | Source operating system | Destination operating system |
x86 | Alibaba Cloud Linux 2 | Alibaba Cloud Linux 3 |
Migration limitations
Limitation category | Description |
General limitations |
|
Migrate CentOS 7 to Alibaba Cloud Linux 2 | Alibaba Cloud Linux 2 uses kernel 4.19, while CentOS 7 uses kernel 3.10. The two kernel versions are not compatible. For services that depend on kernel interface programming, such as those that involve kernel out-of-tree (OOT) module development or hardware enablement, you must perform an evaluation in advance to determine whether a direct migration is suitable. This prevents services from failing to run after the migration. |
Migrate CentOS 7 to Alibaba Cloud Linux 3 | CentOS 7 uses kernel 3.10. Alibaba Cloud Linux 3 uses Linux kernel 5.10 LTS as its kernel and GCC 10.2, binutils 2.35, and glibc 2.32 as the basic toolchain. The two kernel versions are not compatible. For services that depend on kernel interface programming, such as those that involve kernel OOT module development or hardware enablement, you must perform an evaluation in advance to determine whether a direct migration is suitable. This prevents services from failing to run after the migration. |
Migrate CentOS 8 to Alibaba Cloud Linux 3 | Alibaba Cloud Linux 3 uses Linux kernel 5.10 LTS as its kernel and GCC 10.2, binutils 2.35, and glibc 2.32 as the basic toolchain. Its package ecosystem is compatible with CentOS 8. When you use the operating system migration tool described in this topic to migrate CentOS 8 to Alibaba Cloud Linux 3, the tool performs a basic check on the operating system to be migrated. |
In addition, you need to be aware of the following migration limitations for operating system-related features or software:
Feature or software | Support status | Does it affect the operating system migration process? | Description |
i386-architecture packages | Not supported | Yes | Alibaba Cloud Linux does not provide i386-architecture packages. If your current CentOS 7/8 system has i386-architecture packages, you cannot use the migration tool to migrate the operating system. You need to delete these packages before performing the migration to avoid system exceptions during migration. |
epel-modular | Not supported | No | The platform on which the EPEL repository in CentOS 7/8 depends is different from that in Alibaba Cloud Linux 3. Therefore, you can migrate the operating system, but note that you cannot install epel-modular-based packages after migration. |
C/C++ program compatibility | Not guaranteed | No | Alibaba Cloud Linux 3 uses GCC 10.2, binutils 2.35, and glibc 2.32 as the basic toolchain, and the system's own packages have been made compatible. After the operating system migration, we recommend that you recompile and verify your C/C++ programs based on the new basic toolchain to avoid compatibility issues. |
Kernel module compatibility | Not supported | No | Alibaba Cloud Linux 3 uses Linux kernel 5.10 LTS as its kernel, and its package ecosystem is compatible with CentOS 8. However, you need to note that Alibaba Cloud Linux 3 is not fully compatible with the 3.10 kernel of CentOS 7 and the 4.18 kernel of CentOS 8. Therefore, for services that depend on kernel interface programming (such as kernel OOT module development and hardware enablement), you need to perform a migration evaluation on your own before migration to prevent services from failing to run after migration. |
MySQL database | Only migration to the same or a later version of MySQL is supported |
| Alibaba Cloud Linux 3 supports MySQL databases, but you need to note that because MySQL does not support downgrading, if the MySQL version provided by Alibaba Cloud Linux 3 is earlier than the MySQL version in the CentOS 7/8 to be migrated, you cannot use the migration tool to complete the operating system migration. |
Hot migration of operating system | Not supported | No | When using the operating system migration tool to migrate an operating system, it involves reinstalling software packages, which will cause services in the system to restart, leading to business interruptions. Therefore, before migration, you need to create a snapshot to back up data and isolate the operating system environment to be migrated to avoid affecting normal business. |
Usage notes for migration
Before you migrate the operating system, make sure that you understand the following notes.
Migration phase | Notes |
Before migration |
|
During migration |
|
After migration |
|
Billing
During the migration, the system creates snapshots of all disks on the ECS instance to back up data. You are charged for these snapshots on a pay-as-you-go basis. For more information, see Product Billing.
Procedure
During the migration, the system creates snapshots of all disks on the ECS instance to back up data. You are charged for the created snapshots on a pay-as-you-go basis. For more information, see Product Billing.
Migrate the operating system.
Fast migration (Recommended)
NoteTo use the SMC console to import the information about a migration source, make sure that the following conditions are met:
Cloud Assistant Agent is installed on the migration source. By default, Cloud Assistant Agent is installed on ECS instances that are created based on public images after December 1, 2017.
If you want to import the information as a Resource Access Management (RAM) user, the
AliyunECSAssistantFullAccesspolicy is attached to the RAM user to grant the RAM user the permission to manage Cloud Assistant. For more information, see Grant permissions to a RAM user.
On the Operating System Migration page, click Start Migration.
In the Operating System Migration dialog box, select the ECS instance to migrate by its instance ID and region, and then click Pre-check.

In the Operating System Migration dialog box, the system automatically performs a pre-migration check, which takes about 10 seconds.
If the pre-check status changes from
to
, the pre-check is successful.If the pre-check status changes from
to
, the pre-check failed. Follow the prompts on the interface to resolve the issue and then try migrating again.
After you carefully read the notes for operating system migration, select I Have Read And Understood The Preceding Risks, And I Agree To Authorize Alibaba Cloud To Create Snapshots For All Disks Of This Instance, and then click Next.

In the Operating System Migration dialog box, you can select the destination operating system.
Migrate To The Same Destination Operating System: If you perform a batch migration, you can migrate multiple instances to the same operating system.
Select Destination Operating System By Instance: If you perform a batch migration, you can migrate multiple instances to different operating systems.
Click Check If Migratable to view the migration check result.
The check takes about 30 seconds.
: The operating system can be migrated.
: Migration is not supported. You can view the reason for the failure in the interface prompts.
Click Confirm Migration.
You can view the progress of the operating system migration on the Operating System Migration page.
WarningDuring the operating system migration, do not manually stop, restart, or release the ECS instance. Do not use O&M scripts to perform these operations. Otherwise, the migration fails.
Staged migration
Step 1: Import the migration source
Migration sources can be servers of a variety of types to migrate, such as servers in data centers, VMs, and hosts on third-party cloud platforms. SMC supports multiple methods to import the information about migration sources. You can select a method based on your business requirements. For more information, see the How do I choose a method to import migration sources? section of the "FAQ" topic.
Command-line one-click import of migration source (Recommended)
ImportantThe source server must be accessible over the Internet. If your source server is protected by a firewall, refer to What are the service domains of SMC? and ensure that the corresponding domains and ports are whitelisted in your network security policy.
If your source server cannot access the Internet or you want to improve migration efficiency through the VPC, use the method of importing by client.
On the OS Migration page, click Import Migration source.
Configure the parameters as prompted and copy the activation code command. The following table describes the parameters.
Parameter
Description
Migration Source Type
Select Alibaba Cloud ECS Instance.
Import Method
Select Use CLI to Import Server. Generate an activation code and a command, and run the command on the migration source.
Activation Quota
The number of migration sources whose information you want to import by using the activation code. Valid values: 1 to 1000. Default value: 200.
Validity Period
The validity period of the activation code. Unit: day. Valid values: 1 to 90. Default value: 90.
Activation Code
The activation code. Perform the following steps to generate the activation code and copy the generated command:
Click Generate.
Click the Linux Shell tab.
Click Copy to copy the activation code command.
Log on to the source server and paste and run the copied command as an administrator to import the information about the migration source.
Log on to the Linux server.
Paste and run the copied command as an administrator to import the information about the migration source.

After the command is run, if a message similar to
Import Source Server [s-bp18x8751kgz2oyh****] Successfully!is returned, the information about the migration source is imported.
On the Operating System Migration page of the SMC console, view the status of the migration source in the Real-time Migration Status column.
If the status of the migration source is Migration Source Online, the migration source is successfully imported.
If the migration source is in another state, the import failed. Troubleshoot the failure based on the following solutions and then import the migration source again:
Troubleshoot the failure based on the error message in the console or the log file in the SMC client installation directory. By default, the SMC client is installed in /smc.
For information about common issues and their solutions, see SMC FAQ and Troubleshoot errors.
Import a migration source using the SMC client
For more information about the SMC client, see SMC client usage guide.
On the OS Migration page, click Import Migration source.
On the Import Migration Source page, configure the parameters. The following table describes the parameters.
Parameter
Description
Migration Source Type
Alibaba Cloud ECS Instance
Import Method
Select Client Import.
Import Description
After the Import Description, download the corresponding SMC client based on the source server's operating system (Linux or Windows) and bit version (32-bit or 64-bit).
Import the information about the migration source.
ImportantDuring the migration, do not shut down the SMC client until the migration is complete. Otherwise, the migration source is disconnected from the SMC console, and the migration fails.
You can use a remote connection tool that supports file transfer. For example, you can use WinSCP to upload the SMC client package to the source Linux server.
Connect to the source Linux server and decompress the SMC client package.
Linux 64-bit Genericis used in the example. Run the following command to decompress the package. If you use another version of the SMC client, replace the package name in the command with the name of your SMC client.tar -zxvf go2aliyun_client.tar.gzNoteLinux ARM64 supports the g6r general-purpose instance family and the c6r compute-optimized instance family. For more information about instance types, see the "Arm-based enterprise-level computing instance families" section of the Overview of instance families topic.
(Optional) Exclude the files or directories that you do not need from the migration. For more information, see the How do I filter or exclude files or directories from migration? section of the "FAQ" topic.
ImportantIf you enable the block replication feature, you cannot exclude files or directories from the migration job.
Obtain an activation code or AccessKey pair.
(Recommend) Obtain an activation code: In the Description section in the SMC console, click Generate and copy the generated activation code information.
Obtain an AccessKey pair: An AccessKey pair consists of an AccessKey ID and an AccessKey secret. If no AccessKey pair is created, create one first. For more information, see Obtain an AccessKey pair.
In the SMC client folder, run the following commands to run the SMC client.
cd go2aliyun_client_linux_x86_64 sudo chmod +x go2aliyun_client sudo ./go2aliyun_clientEnter the activation code or AccessKey pair as prompted. The following figure shows an example of an activation code.

The following messages may appear after you enter the activation code.
If no snapshot dependency is installed on your source server, a message appears. The following figure shows the details of the message. You can decide whether to install a snapshot dependency based on whether you enable the block replication feature.
If you want to enable block replication for the migration, enter
yesto automatically install a snapshot dependency.If you do not want to enable block replication for the migration, enter
no.
ImportantIf the snapshot dependency fails to be installed, do not enable block replication when you create a migration job. Otherwise, the migration may fail.

The rsync tool is installed on most mainstream migration sources. If rsync is not installed on the migration source, the SMC client displays a message. Enter
yesto install rsync, as shown in the following figure.
If SELinux is enabled on the migration source, a message that prompts you to disable SELinux appears. Enter
yesto disable SELinux. The following figure shows how to disable SELinux.
If the information about the migration source is imported, a message similar to the following one is returned:
Import Source Server [s-bp11npxndknsycqj****] Successfully!.NoteIf the information about the migration source fails to be imported, you can troubleshoot the issue based on the returned message. After you fix the issue, run the following commands to exit the background program and re-import the information about the migration source. For more information about FAQ and solutions, see FAQ and Errors occurred during a server migration.
sudo ./go2aliyun_client --abort sudo ./go2aliyun_client
On the Operating System Migration page of the SMC console, view the status of the migration source in the Real-time Migration Status column.
If the status of the migration source is Migration SourceOnline, the information about the migration source is imported.
If the migration source is in another state, the information fails to be imported. In this case, troubleshoot the failure based on the following solutions and import the information about the migration source again:
Troubleshoot the failure based on the error message in the console or the log file in the SMC client installation directory. By default, the SMC client is installed in /smc.
For more information about frequently asked questions (FAQ) and solutions, see FAQ and Errors occurred during a server migration.
Step 2: Migration configuration
Find the migration source that you want to manage and click Start Migration in the Actions column.
In the Migration Configuration dialog box, configure the parameters.
The following table describes the operating system migration parameters:
Current Operating System: The current operating system is displayed by default and cannot be modified. Example: CentOS 7.
Destination Operating System: From the drop-down list, select the operating system to which you want to migrate. Example: Alibaba Cloud Linux 3.
Migration Drill (Optional):
Decide whether to enable Migration Drill. This feature is enabled by default and is supported only for Linux operating system migrations. For more information, see Configure a migration drill.
NoteA migration drill simulates and verifies a migration solution before the actual migration. It helps you understand the feasibility and risks of the migration solution, which reduces potential problems and data loss during the actual migration.
A migration drill can help you quickly identify potential problems, provide solutions, and improve the success rate of the migration.
Execution Method (Conditional):
If Migration Drill is enabled, you can select a migration drill execution method from the Execution Method drop-down list. The default option is Drill And Migrate.
The following list describes the differences between the two methods:
Drill Only: Creates only a migration drill task. After the migration drill is complete, if an operating system migration is required, you must manually start the migration task.
Drill And Migrate: After the migration drill is complete, if no drill items are in the Critical state, the system automatically starts the operating system migration task.
Click Start Migration. In the Please Confirm Operating System Migration dialog box, carefully read the notes and then click I Confirm I Have Been Informed.
On the Operating System Migration page, view the real-time migration status.
WarningDuring the operating system migration, do not manually stop, restart, or release the Linux instance. Do not use O&M scripts to perform these operations. Otherwise, the migration fails.
Verify the migration result
Clear resources
During the migration, SMC creates one pay-as-you-go snapshot named SMC_Backup_Snapshot_XXX for disks of the ECS instance for data backup. If you no longer need this snapshot, delete it in time to avoid unnecessary charges. For more information, see Delete a snapshot.

