Operating system migration (Linux)
When your ECS instance's operating system reaches end of life (EOL) or needs an upgrade, use Server Migration Center (SMC) to migrate it in place while retaining all system disk data. Supported sources: CentOS 7/8, Red Hat 7/8, and Alibaba Cloud Linux 2.
Migration from CentOS 7/8 to Red Hat 7/8 using SMC is currently available to select users only. To request access, submit a ticket.
Background
An EOL operating system (Overview of operating system lifecycles) poses increased security and operational risks. SMC provides migration solutions that convert and upgrade the OS kernel and major system packages in place while retaining system disk data.
If you do not need to retain system disk data or need more OS conversion options, use the Replace the system disk feature instead.
Migration paths
CentOS 7/8
|
Architecture |
Source |
Destination |
|
x86 |
CentOS 7.x |
|
|
CentOS 8.x |
|
|
|
ARM64 |
CentOS 7.x |
|
|
CentOS 8.x |
|
Red Hat 7/8
|
Architecture |
Source |
Destination |
|
x86 |
Red Hat 7.9 |
|
|
Red Hat 8.x |
|
Alibaba Cloud Linux 2
|
Architecture |
Source |
Destination |
|
x86 |
Alibaba Cloud Linux 2 |
Alibaba Cloud Linux 3 |
Migration limitations
|
Category |
Description |
|
General limitations |
|
|
Migrate from CentOS 7 to Alibaba Cloud Linux 2 |
Alibaba Cloud Linux 2 uses kernel 4.19, which is not compatible with the CentOS 7 kernel 3.10. Workloads that depend on kernel interface programming (such as OOT kernel module development or hardware enablement) require pre-migration evaluation. |
|
Migrate from CentOS 7 to Alibaba Cloud Linux 3 |
Alibaba Cloud Linux 3 uses kernel 5.10 LTS with GCC 10.2, binutils 2.35, and glibc 2.32 as its toolchain, which is not compatible with the CentOS 7 kernel 3.10. Workloads that depend on kernel interface programming (such as OOT kernel module development or hardware enablement) require pre-migration evaluation. |
|
Migrate from CentOS 8 to Alibaba Cloud Linux 3 |
Alibaba Cloud Linux 3 uses kernel 5.10 LTS with GCC 10.2, binutils 2.35, and glibc 2.32. Its package ecosystem is compatible with CentOS 8. The migration tool performs a basic check on the source OS before proceeding. |
Additional migration limitations for specific features or software:
|
Feature or software |
Support status |
Affects migration |
Description |
|
i386-architecture packages |
Not supported |
Yes |
Alibaba Cloud Linux does not provide i386-architecture packages. Remove all i386 packages from your CentOS 7/8 system before migration. |
|
epel-modular |
Not supported |
No |
The EPEL repositories in CentOS 7/8 and Alibaba Cloud Linux 3 depend on different platforms. Migration proceeds, but epel-modular-based packages cannot be installed after migration. |
|
C/C++ program compatibility |
Not guaranteed |
No |
Alibaba Cloud Linux 3 uses GCC 10.2, binutils 2.35, and glibc 2.32. Recompile and verify your C/C++ programs with the new toolchain after migration. |
|
Kernel module compatibility |
Not supported |
No |
Alibaba Cloud Linux 3 uses kernel 5.10 LTS and is package-compatible with CentOS 8, but not fully compatible with the CentOS 7 kernel 3.10 or CentOS 8 kernel 4.18. Workloads that depend on kernel interface programming (such as OOT kernel module development or hardware enablement) require a migration assessment. |
|
MySQL database |
Migration is supported only to the same or a later version of MySQL. |
|
Alibaba Cloud Linux 3 supports MySQL, but MySQL does not support downgrades. If the destination MySQL version is older than your source version, migration is blocked. |
|
Hot migration |
Not supported |
No |
OS migration reinstalls packages and restarts services, causing downtime. Before migrating, create a snapshot to back up data and isolate the source environment. |
Migration considerations
Review these considerations before migration.
|
Migration phase |
Considerations |
|
Before migration |
|
|
During migration |
|
|
After migration |
|
Billing
The system creates snapshots of all cloud disks during migration, which incur pay-as-you-go charges. Product billing.
Procedure
The system creates snapshots of all disks during migration. You are charged for these snapshots on a pay-as-you-go basis. Product billing.
-
-
Migrate the operating system.
Fast migration
NoteIf your instance was purchased before December 1, 2017, created from a custom image that you uploaded, or is a third-party cloud server, you must install the Cloud Assistant Agent on the ECS instance to use this method. ECS instances created from public images after December 1, 2017 have the required Cloud Assistant Agent pre-installed by default. You can ignore this note.
-
Go to the Operating System Migration page in the SMC console.
-
On the OS Migration page, click Start Migration.
-
In the OS Migration dialog box, select the ECS instance to migrate by its instance ID and region, and then click Pre-check.
-
In the OS Migration dialog box, the system automatically performs a pre-check. The check 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 on-screen instructions to resolve the issue and then try again.
-
-
Carefully read the notes for operating system migration, select I acknowledge and accept these risks and authorize Alibaba Cloud to create snapshots for all disks on the instance., and then click Next.
Confirm that the Pre-check result for the instance is Ready.
-
In the Operating System dialog box, select a target operating system as needed.
-
Migrate to the same target operating system: If you perform a batch migration, you can migrate multiple instances to the same operating system.
-
Select a target operating system for each instance: If you perform a batch migration, you can migrate multiple instances to different operating systems as needed.
-
-
Click Check Migratability to view the migration check result.
The check takes about 30 seconds.
-
: The operating system can be migrated. -
: The operating system cannot be migrated. Follow the on-screen instructions to view the reason.
-
-
Click Migrate.
View the progress of the operating system migration on the OS Migration page.
WarningDuring the operating system migration, do not manually stop, restart, or release the ECS instance, or perform these operations by using O&M scripts. Otherwise, the migration fails.
Step-by-step migration
Step 1: Import migration source
A migration source is a physical server, VM, or instance from another cloud platform that you want to migrate.
Command-line import
Important-
The source server must have public network access. If the source server is behind a firewall, see What are the SMC service domains? to obtain the SMC endpoints and ports, and then add them to your firewall allowlist.
-
If your source server cannot access the public network or you want to use a private network for a faster migration, see Private network migration.
-
Go to the Operating System Migration page in the SMC console.
-
On the OS Migration page, click Import Source Servers.
-
Configure the parameters as prompted and copy the activation code command. The following table describes the parameters.
Parameter
Description
Migration Source Type
Select ECS Instance.
Import Method
Select Use CLI to Import Server.
Migration Source Quota
The number of migration sources that can be activated by the activation code. Valid values: 1 to 1,000. Default value: 200.
Validity Period
The validity period of the activation code, in days. Valid values: 1 to 90. Default value: 90.
Activation Code
Generate the activation code and copy the command:
-
Click Generate.
-
Click the Linux Shell tab.
-
Click Copy to copy the activation code command.
-
-
Log on to the source server, and then paste and run the copied command with administrator privileges to import the migration source.
-
Log on to the Linux source server.
-
Paste and run the copied command with administrator privileges to import the migration source.
wget https://p2v-tools.oss-cn-hangzhou.aliyuncs.com/smc/China_Mainland/run_smc_client.sh && sudo bash run_smc_client.sh --accesstokenid at-bp1bq****94dnpodl1cm --accesstokencode xxxxxxIf you receive a message similar to
Import Source Server [s-bp18x8751kgz2oyh****] Successfully!, the migration source has been successfully imported.
-
-
On the OS 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 Online, the import is successful.
-
If the migration source is in another state, the import failed. Troubleshoot the issue and then import the migration source again.
-
Troubleshoot the issue based on the error message in the console or the log file in the SMC client directory. By default, the SMC client is installed in the /smc directory.
-
Common issues and solutions: SMC FAQ and Troubleshoot errors.
-
-
Client import
Download and configure the client as described in the SMC Client User Guide.
-
Go to the Operating System Migration page in the SMC console.
-
On the OS Migration page, click Import Source Servers.
-
On the Import Migration Source page, configure the parameters as described in the following table.
Parameter
Description
Migration Source Type
ECS Instance
Import Method
Select Use Client to Import Server.
Description
In the Description section, download the SMC client for your source server based on its OS and architecture (32-bit or 64-bit).
-
Import the migration source.
ImportantDo not close the SMC client during the migration. Otherwise, the migration source loses its connection to the SMC console and the migration fails.
-
Use a remote connection tool that supports file transfer, such as WinSCP, to upload the SMC client to the Linux source server, or run the command provided in the import instructions to download the SMC client directly on the source server.
-
Remotely connect to the Linux source server and decompress the SMC client package.
This example uses the
Linux 64-bit General-purpose Edition. If you use a different version of the SMC client, replace the package name in the command with the name of the file you downloaded.tar -zxvf go2aliyun_client.tar.gzNoteThe Linux 64-bit ARM Edition supports the g6r general-purpose instance family and the c6r compute-optimized instance family. For more information about instance families, see Enterprise-level Arm-based compute instance families.
-
(Optional) You can filter or exclude files and directories from the migration.
ImportantIf you enable block replication for the migration, you cannot exclude files or directories.
-
Obtain an activation code or an AccessKey pair.
-
(Recommended) Obtain an activation code: In the Description section of the SMC console, click Generate and copy the activation code.
-
Obtain an AccessKey pair: An AccessKey pair consists of an AccessKey ID and an AccessKey secret. If you have not created one, see Create an AccessKey pair.
-
-
In the SMC client directory, run the following commands to start the SMC client.
The directory
go2aliyun_client...is an example. Replace it with the actual directory name created when you decompress the package, as the name varies by client version.cd go2aliyun_client2.6.5_linux_x86_64 sudo chmod +x go2aliyun_client sudo ./go2aliyun_client -
Enter the activation code or AccessKey pair as prompted. The following example shows how to enter an activation code:
$ sudo ./go2aliyun_client go2aliyun_client China version 2.6.5 Access Token Id: at-bp1bq****94dnpodl1cm Access Token Code: ****After entering the activation code or AccessKey pair, the following prompts may appear:
-
If a snapshot driver is not installed on the source system, the SMC client prompts you to install one. Respond to the prompt based on your migration plan.
-
If you plan to enable block replication when you create the migration task, enter
yesto automatically install the snapshot driver. -
If you do not plan to enable block replication, enter
no.
ImportantIf the snapshot driver fails to install, do not enable block replication when you create the migration task. Otherwise, the migration will fail.
Install snapshot dependences(gcc/make/kernel-devel)? (yes/no): yes -
-
Most mainstream source systems have rsync installed by default. If rsync is not installed, the SMC client prompts you to install it. Enter
yesto automatically install rsync.Need to install rsync, run 'apt-get -y install rsync' to continue? (yes/no): yes -
If SELinux is enabled on the source system, the SMC client prompts you to disable it. Enter
yesto automatically disable SELinux.Need to disable SELINUX, run 'setenforce 0' to continue? (yes/no): yes
When you receive a message similar to
Import Source Server [s-bp11npxndknsycqj****] Successfully!, the migration source has been successfully imported.NoteIf the import fails, troubleshoot the issue based on the returned message. Then, run the following commands to exit the background process and re-import the migration source. For information about common issues and solutions, see SMC FAQ and Troubleshooting.
sudo ./go2aliyun_client --abort sudo ./go2aliyun_client -
-
-
On the OS Migration page of the SMC console, view the status of the migration source in the Real-time Migration Status column.
-
If the status is Migration SourceOnline, the import was successful.
-
If the status is anything else, the import has failed. See the following solutions to resolve the issue, and then import the data again.
-
Troubleshoot the issue based on the error message in the console or the log file in the SMC client directory. By default, the SMC client is installed in the /smc directory.
-
For information about common issues and solutions, see SMC FAQ and Troubleshooting.
-
-
Step 2: Configure migration
-
In the Actions column of the migration source that you want to manage, click Start Migration.
-
In the Migration Settings dialog box, configure the parameters.
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 target operating system. Example: Alibaba Cloud Linux 3.
-
Migration Test (Optional):
You can enable Migration Test. This feature is enabled by default and supports only Linux migrations. Configure a migration drill.
NoteA migration drill simulates the migration to assess feasibility and risks before the actual migration.
Drills help identify potential problems early and improve migration success rates.
-
Execution Method (Conditional):
If Migration Test is enabled, you can select an execution mode from the Execution Method drop-down list. The default option is Test and Migrate.
Differences between the two modes:
-
Test 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 operating system migration task.
-
Test 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 Migrate Operating System dialog box, carefully read the notes and then click I Acknowledge.
-
On the OS Migration page, view the real-time migration status.
WarningDuring the operating system migration, do not manually stop, restart, or release the ECS instance, or perform these operations by using O&M scripts. Otherwise, the migration fails.
-
Verify the migration result
Resource cleanup
During migration, Server Migration Center (SMC) creates a pay-as-you-go snapshot named SMC_Backup_Snapshot_XXX to back up the data on the cloud disk of an ECS instance. If you no longer need this snapshot, delete it promptly to avoid unnecessary charges. For more information, see Delete a snapshot.
: The operating system cannot be migrated. Follow the on-screen instructions to view the reason.