All Products
Search
Document Center

Server Migration Center:Operating system migration (Linux)

Last Updated:Aug 02, 2025

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.

Note

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.

Note

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

  • AnolisOS 7

  • AnolisOS 8

  • Alibaba Cloud Linux 2

  • Alibaba Cloud Linux 3

    Note

    For more information about Alibaba Cloud Linux, see What is Alibaba Cloud Linux?.

  • Red Hat 7

    Note

    Currently, only some users can upgrade from CentOS 7.9 to Red Hat 7. If you want to use this feature, you can to apply for the feature to be added to the whitelist.

CentOS 8.x

  • AnolisOS 8

  • Alibaba Cloud Linux 3

  • Red Hat 8

    Note

    Currently, only some users can upgrade from CentOS 8.5 to Red Hat 8. If you want to use this feature, you can to apply for the feature to be added to the whitelist.

ARM64

CentOS 7.x

  • AnolisOS 7

  • AnolisOS 8

  • Alibaba Cloud Linux 3

CentOS 8.x

  • AnolisOS 8

  • Alibaba Cloud Linux 3

Red Hat 7/8

Operating system architecture

Source operating system

Destination operating system

x86

Red Hat 7.9

  • Alibaba Cloud Linux 3

  • Red Hat 8

    Note

    You cannot specify a minor version of Red Hat as the destination operating system during migration.

Red Hat 8.x

  • Red Hat 9

    Note

    You cannot specify a minor version of Red Hat as the destination operating system during migration.

  • Alibaba Cloud Linux 3

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

  • Anolis OS and Alibaba Cloud Linux do not provide i686-architecture packages. If your system has i386-architecture (including i686) packages from CentOS installed, the migration cannot proceed. For migration limitations of specific features or software, see Migration limitations for features or software.

  • The operating system migration tool downloads and installs software packages, which consumes system resources. Before you start the migration, ensure that the instance has the following available resources:

    • Memory size: 600 MiB

    • Disk capacity:

      • The /usr directory requires 250 MiB.

      • The /var directory requires 4 GiB.

      • The /boot directory requires 100 MiB.

    Note

    If your instance has limited computing resources (vCPUs and memory) or storage resources (system disk and data disks), we recommend that you stop the services on the instance before the migration to prevent migration failure due to insufficient resources.

  • Only specific migration solutions are supported.

  • Migration is not supported if a snapshot is being created for the instance. You must wait for the snapshot creation to complete before you start the migration.

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

  • No impact if migrating to the same or a later version of MySQL

  • Impact if migrating to an earlier version of MySQL

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

Important

Before you migrate the operating system, make sure that you understand the following notes.

Migration phase

Notes

Before migration

  • The preparations for the migration are complete. For more information, see Preparations.

  • Before the official migration, we strongly recommend that you understand the migration limitations and complete comprehensive testing and verification of all business applications in the destination operating system environment in advance. This ensures compatibility and performance between the applications and the destination operating system, thereby effectively avoiding issues such as poor business operation or functional failure after migration.

  • During the migration, the kernel and software packages of the source instance system will be installed or updated, and the system will be automatically restarted multiple times. During this period, business cannot run normally. We recommend that you evaluate the impact and suspend your business before proceeding with the operation.

During migration

  • During the migration process, do not manually stop, restart, or release the ECS instance, or use O&M scripts to do so. Otherwise, the migration may fail.

  • A migration drill or canceling the migration may trigger an automatic rollback to the pre-migration snapshot, and data generated during the migration will be lost.

  • The migration process involves operations such as creating snapshots for the ECS instance, converting the operating system kernel version, reinstalling and upgrading software packages, and stopping and starting the instance. We recommend that you back up important data in advance and schedule a reasonable migration window to avoid business impact from these operations.

  • During the migration, the system will conduct migration condition checks and pre-migration assessments on the source instance. If the source system does not meet the migration conditions or the pre-migration assessment fails, the migration will be interrupted with an error, and successful migration is not guaranteed. We recommend that you familiarize yourself with the migration conditions and troubleshooting documents and conduct tests in advance. For migration issues, see Operating system migration issues (Linux) and Red Hat official documentation for troubleshooting migration issues.

After migration

  • After the migration, the instance will automatically start. The instance ID, image ID, instance VPC, instance public/private IP address, and instance hostname will remain unchanged. The instance operating system will be changed to the destination operating system after migration.

  • The data on the original system disk remains unchanged, but application software may not run normally due to changes in the environment or dependencies, causing business to fail. Therefore, please conduct thorough testing and verification.

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

Important

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.

  1. (Conditional) To migrate CentOS 7/8 to Red Hat 7/8, you must complete the following operations. Otherwise, skip this step.

    1. If the Security Center client is installed on the source system, you must first uninstall it.

      Note

      You can reinstall it after the migration is complete. For more information, see Manual installation.

      After the agent is uninstalled, Security Center still protects your server for 24 hours. If you want to reinstall the agent, install the agent 24 hours later. If you want to reinstall the agent within 24 hours after the agent is uninstalled, you must run the installation command at least three times and ignore the error messages during the installation. Otherwise, the reinstalled agent is automatically uninstalled.

      1. Go to the Alibaba Cloud Security Center client uninstallation interface and select the instance from which to uninstall the client. For more information, see Uninstall the client.

      2. Use a remote connection tool to connect to the server and run the following command.

        wget "http://update2.aegis.aliyun.com/download/uninstall.sh" && chmod +x uninstall.sh && ./uninstall.sh
        if ! lsmod | grep AliSecGuard; then echo 'Uninstall Success'; else echo "Uninstall Failed"; fi

        The Uninstall Success message indicates that the Security Center client is uninstalled.

    2. Run the following command to upgrade the source system to the latest kernel version.

      CentOS 7

      # Back up the original yum software source and update it to the Alibaba Cloud CentOS 7 source.
      mv /etc/yum.repos.d/ /etc/yum.repos.d.backup/
      mkdir -p /etc/yum.repos.d/
      wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
      wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
      yum clean all
      yum makecache
      # Update and restart the system.
      yum -y update
      reboot

      CentOS 8

      # Back up the original yum software source and update it to the Alibaba Cloud CentOS 8 source.
      mv /etc/yum.repos.d/ /etc/yum.repos.d.backup/
      mkdir -p /etc/yum.repos.d/
      wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.aliyuncs.com/repo/Centos-8.repo
      wget -O /etc/yum.repos.d/epel-archive-8.repo http://mirrors.cloud.aliyuncs.com/repo/epel-archive-8.repo
      yum clean all
      yum makecache
      # Update and restart the system.
      yum -y update
      reboot
  2. Migrate the operating system.

    Fast migration (Recommended)

    Note

    To 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 AliyunECSAssistantFullAccess policy 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.

    1. Go to SMC console - Operating System Migration.

    2. On the Operating System Migration page, click Start Migration.

    3. In the Operating System Migration dialog box, select the ECS instance to migrate by its instance ID and region, and then click Pre-check.

      image

    4. 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 image to image, the pre-check is successful.

      • If the pre-check status changes from image to image, the pre-check failed. Follow the prompts on the interface to resolve the issue and then try migrating again.

    5. 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.

      image

    6. 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.

    7. Click Check If Migratable to view the migration check result.

      The check takes about 30 seconds.

      • image: The operating system can be migrated.

      • image: Migration is not supported. You can view the reason for the failure in the interface prompts.

    8. Click Confirm Migration.

      You can view the progress of the operating system migration on the Operating System Migration page.

      Warning

      During 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)

    Important
    • The 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.

    1. Go to SMC console - Operating System Migration.

    2. On the OS Migration page, click Import Migration source.

    3. 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:

      1. Click Generate.

      2. Click the Linux Shell tab.

      3. Click Copy to copy the activation code command.

    4. Log on to the source server and paste and run the copied command as an administrator to import the information about the migration source.

      1. Log on to the Linux server.

      2. Paste and run the copied command as an administrator to import the information about the migration source.

        image.png

        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.

    5. 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.

    1. Go to SMC console - Operating System Migration.

    2. On the OS Migration page, click Import Migration source.

    3. 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).

    4. Import the information about the migration source.

      Important

      During 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.

      1. 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.

      2. Connect to the source Linux server and decompress the SMC client package.

        Linux 64-bit Generic is 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.gz
        Note

        Linux 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.

      3. (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.

        Important

        If you enable the block replication feature, you cannot exclude files or directories from the migration job.

      4. 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.

      5. 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_client
      6. Enter the activation code or AccessKey pair as prompted. The following figure shows an example of an activation code.adad

        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 yes to automatically install a snapshot dependency.

          • If you do not want to enable block replication for the migration, enter no.

          Important

          If the snapshot dependency fails to be installed, do not enable block replication when you create a migration job. Otherwise, the migration may fail.

          123

        • 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 yes to install rsync, as shown in the following figure.安装rsync

        • If SELinux is enabled on the migration source, a message that prompts you to disable SELinux appears. Enter yes to disable SELinux. The following figure shows how to disable SELinux.关闭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!.

        Note

        If 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
    5. 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

    1. Find the migration source that you want to manage and click Start Migration in the Actions column.

    2. 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.

        Note

        A 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.

    3. 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.

    4. On the Operating System Migration page, view the real-time migration status.

      Warning

      During 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

  • If the real-time migration status is Completed, the operating system migration is successful.

    image

    Note

    After the migration task is complete, the ECS instance automatically restarts. During the system initialization phase, operations such as updating software packages are performed. Do not perform any operations on the ECS instance until the system successfully starts. The system initialization phase takes about 15 to 30 minutes. The specific duration depends on the number of system software packages.

    In the Actions column for the destination migration source, click View Destination Instance. Then, on the instance details page, check whether the operating system is migrated to the destination operating system.

    Important

    After the migration, the source instance is migrated to the new system kernel and software packages. The original system disk data remains unchanged. However, applications may not run as expected due to changes in the environment or dependencies, which can cause business failures. You must perform thorough testing and verification.

  • If the Real-time Migration Status is Error, the migration task has encountered an error.

    In this case, you need to perform the following operations:

    1. Click Troubleshoot Errors in the Actions column and fix issues based on the error code and description. For more information, see FAQ and Errors occurred during a server migration.

    2. After the issues are fixed, click Retry Migration in the Actions column of the migration job.

      The migration job resumes from the point where it was suspended.

      Important

      If the intermediate instance is released, you must create another migration job. For more information, see the What do I do if I accidentally release an intermediate instance? section of the "FAQ" topic.

    To roll back the data on the source system disk, you can use the automatically created backup snapshot to restore the data. The steps are as follows:

    1. Go to the ECS console - Snapshots.

    2. In the Actions column of the automatically created backup snapshot, click Roll Back Disk. image

    3. In the Roll Back Disk dialog box, click Confirm.

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.