All Products
Search
Document Center

Server Migration Center:Migrate a Linux operating system

Last Updated:Apr 02, 2024

Technical support may no longer be available for operating systems due to reasons such as end of service lifecycle, end of third-party support, or evolution of open source projects. For example, CentOS has announced the end of life (EOL) for CentOS Linux versions, including CentOS 7 and CentOS 8. Such operating systems that enter the EOL may face security vulnerabilities. If the operating system of your Elastic Compute Service (ECS) instance meets the migration requirements, you can seamlessly migrate the operating system to another operating system by using Server Migration Center (SMC) for future maintenance and technical support. This topic describes how to use SMC to migrate a Linux operating system.

Important

Only specific users can use SMC to migrate CentOS 7 or CentOS 8 operating systems to Red Hat 7 or Red Hat 8. If you want to use this feature, submit a ticket to apply for the qualification.

Prerequisites

  • The preparations for the migration are complete. For more information, see Before you begin.

  • The source operating system can access the following public networks if you want to migrate a CentOS 7 or CentOS 8 operating system to Red Hat 7 or Red Hat 8:

    • https://www.redhat.com

    • https://ftp.redhat.com

    • https://cdn-public.redhat.com

    • https://developer.aliyun.com

    • http://developer.aliyun.com

Comparison of migration solutions

The following table compares three operating system migration solutions.

Migration solution

Usability

Reliability

Service

Migration result

(Recommended) Migrate an operating system in the SMC console

★★★★★

  • Operations are performed based on GUI. The migration progress is displayed.

  • Logs are displayed in the SMC console.

★★★★★

Snapshots are automatically created without manual intervention.

★★★★★

The migration solution is integrated into the Alibaba Cloud Global Technology Services (GTS) system and helps you fix issues by using mature processes.

★★★★★

  • The displayed version of the destination operating system in the SMC console is the same as the actual version of the destination operating system.

  • If the source and destination operating systems are of the same version, applications are inherited from the source operating system. Otherwise, applications are adapted to the destination operating system.

  • The data on the system disk is retained.

Replace an operating system (a system disk) in the ECS console

★★★★

Operations are performed based on GUI.

★★★★

Snapshots are manually created.

★★★★★

The migration solution is integrated into the Alibaba Cloud GTS system and helps you fix issues by using mature processes.

★★★

  • The displayed version of the destination operating system in the SMC console is the same as the actual version of the destination operating system.

  • Applications are redeployed.

  • The data on the system disk is not retained.

Run migration scripts on ECS instances

★★★

  • Operations are performed by using scripts. Logs are displayed as scripts.

  • Risks may occur when operations are performed on ECS instances.

★★★

Snapshots are manually created.

★★★

The migration solution is supported by the community.

★★★

  • Changes on ECS instances are imperceptible to the console. The displayed version of the destination operating system in the console may be different from the actual version of the destination operating system.

  • If the source and destination operating systems are of the same version, applications are inherited from the source operating system. Otherwise, applications are adapted to the destination operating system.

Scenarios

The following table describes the x86- or ARM64-based operating systems that can be migrated by using SMC and the corresponding operating systems to which they can be migrated.

Operating system architecture

Source operating system

Destination operating system

X86

CentOS 7

  • AnolisOS 7

  • AnolisOS 8

  • Red Hat 7

    Important

    Only a CentOS 7.9 operating system can be migrated to Red Hat 7.

  • Alibaba Cloud Linux 2

  • Alibaba Cloud Linux 3

CentOS 8

  • AnolisOS 8

  • Red Hat 8

    Important

    Only a CentOS 8.5 operating system can be migrated to Red Hat 8.

  • Alibaba Cloud Linux 3

  • Red Hat 7

    Important

    Only Red Hat 7.9 is supported.

  • Red Hat 8

Alibaba Cloud Linux 3

Alibaba Cloud Linux 2

Alibaba Cloud Linux 3

ARM64

CentOS 7

  • AnolisOS 7

  • AnolisOS 8

  • Alibaba Cloud Linux 3

CentOS 8

  • AnolisOS 8

  • Alibaba Cloud Linux 3

Important

The source operating system must be the operating system of an ECS instance in the current Alibaba Cloud account.

Usage notes

  • During the migration process, the following operations are performed on the ECS instance: creating snapshots for basic disks, reinstalling software packages, creating a custom image from a system disk snapshot, replacing the system disk, stopping the ECS instance, and starting the ECS instance. After the system disk is replaced, a new disk is created for the system disk. Automatic snapshots that are released with the original disk are deleted and cannot be restored. We recommend that you back up important data and plan a proper migration time to prevent the preceding operations from affecting your business.

  • During the migration process, do not stop, restart, or release the ECS instance in manual mode or by using O&M scripts.

  • During the migration process, snapshots are created for all disks to back up data. You are charged for snapshots based on the pay-as-you-go billing method. For more information about the billing methods and rules of snapshots, see Snapshots.

  • The migration of an operating system is irreversible. You need to reinstall software packages during the migration process. Therefore, before you migrate the operating system of your ECS instance, we recommend that you create snapshots for the ECS instance to back up data. For more information about snapshots, see Overview.

  • YUM or DNF is used for migration. Make sure that these two components run as expected.

Limits

Item

Description

General limit

  • Anolis OS and Alibaba Cloud Linux do not provide i686-based software packages. If your CentOS operating system is equipped with i386-based or i686-based software packages, you cannot migrate to Anolis OS or Alibaba Cloud Linux.

  • The operating systems of instances that are created from custom images cannot be migrated.

  • The migration tool consumes resources to download and install software packages during migration. Before you migrate an operating system of an ECS instance, make sure that the following resources are available:

    • Memory size: 600 MiB

    • Available disk capacity for the following directories:

      • /usr: 250 MiB

      • /var: 4 GiB

      • /boot: 100 MiB

    Note

    If your instance has a small number of vCPUs, little memory, and a small storage capacity for the system disk and data disks, we recommend that you stop the services that are running on the instance before you perform migration. This helps prevent migration failures caused by insufficient resources.

Limit on migrating from CentOS 7 to Alibaba Cloud Linux 2

Alibaba Cloud Linux 2 uses kernel version 4.19, which is incompatible with kernel version 3.10 of CentOS 7. If your business uses applications that depend on kernel APIs for different purposes, such as building out-of-tree kernel modules and using hardware resources, you must assess the applications in advance and determine whether they can run as expected after a direct migration.

Limit on migrating from CentOS 7 to Alibaba Cloud Linux 3

Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, which is incompatible with kernel version 3.10 of CentOS 7. In addition, the GNU toolchain of Alibaba Cloud Linux 3 contains GCC 10.2, Binutils 2.35, and glibc 2.32. If your business uses applications that depend on kernel APIs for different purposes, such as building out-of-tree kernel modules and using hardware resources, you must assess the applications in advance and determine whether they can run as expected after a direct migration.

Limit on migrating from CentOS 8 to Alibaba Cloud Linux 3

Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, which is compatible with the CentOS 8 ecosystem. In addition, the GNU toolchain of Alibaba Cloud Linux 3 contains GCC 10.2, Binutils 2.35, and glibc 2.32. Alibaba Cloud Linux 3 is compatible with the CentOS 8 ecosystem. When you use the migration tool to migrate from CentOS 8 to Alibaba Cloud Linux 3, the migration tool performs a basic assessment on the operating system that you want to migrate.

Procedure

  1. Perform the following steps if you want to migrate a CentOS 7 or CentOS 8 operating system to Red Hat 7 or Red Hat 8. Otherwise, skip this step.

    1. If the Security Center agent is installed on the source operating system, uninstall it.

      Note

      You can reinstall the Security Center agent after the migration and system upgrade are complete. For more information, see the Manually install the Security Center agent section of the "Install the Security Center agent" topic.

      1. Go to the Feature Settings page of the Security Center console. Find the server from which you want to uninstall the Security Center agent and uninstall the Security Center agent. For more information, see Uninstall the Security Center agent.

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

        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

        If Uninstall Success is returned, the Security Center agent is uninstalled.

    2. Run the following command to update the source operating system to the latest kernel version:

      CentOS 7

      # Back up the source YUM software repository and replace it with the Alibaba Cloud repository of CentOS 7.
      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 operating system.
      yum -y update
      reboot

      CentOS 8

      # Back up the source YUM software repository and replace it with the Alibaba Cloud repository of CentOS 8.
      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 operating system.
      yum -y update
      reboot
  2. Import the information about the migration source.

    You can import the information about a migration source by using one of the following methods:

  3. Create and start the migration task.

    1. On the Migration Sources page, find the migration source generated for the source operating system, and click Create Migration Job in the Actions column.

    2. In the Create Migration Job dialog box, configure the parameters to create an operating system migration task.

      The following table describes the parameters that you can configure to create an operating system migration job.

      Parameter

      Description

      Migration Job Type

      The type of the migration job. Select Operating System Migration.

      Current Operating System

      By default, the current operating system is displayed and cannot be modified. In this example, CentOS 7 is displayed.

      Destination operating system

      The operating system to which you want to migrate the source operating system. Select an operating system from the drop-down list. In this example, Alibaba Cloud Linux 3 is selected.

      Migration Test

      Specifies whether to enable the migration test feature. A migration test is a process of simulating and verifying a migration solution before you perform an actual migration. A migration test helps you fully understand the feasibility and risks of a migration solution before you perform an actual migration. This reduces the issues and losses that may occur during the actual migration.

      A migration test helps you identify issues that may occur during the migration, provides solutions to the issues, and improves the migration success rate.

      By default, the migration test feature is enabled. You can perform a migration test only on migration sources that run the Linux operating system. For more information, see Configure a migration test.

      Execution Method

      The mode in which you want to perform a migration test. By default, Test and Migrate is selected. Valid values:

      • Test Only: The system performs only the migration test. After the migration test is complete, you must manually start the operating system migration job.

      • Test and Migrate: The system performs the migration test. After the migration test is complete, if no test items are in the Critical state, the system automatically starts the operating system migration job.

      image

    3. Click Create.

    4. In the Migrate Operating System dialog box, read the message and click Got It.

  4. On the Operating System Migration tab of the Migration Jobs page, wait until the migration job is complete.

    • If the migration job enters the Completed state, the operating system is migrated.

      image

      In the Instance ID/Name column of the migration job, view and record the ECS instance ID. On the Instances page of the ECS console, find the ECS instance based on the ECS instance ID and go to the details page of the ECS instance. In the Configuration Information section of the Instance Details tab of the instance details page, you can find that the source operating system is migrated to the destination operating system.

      image

    • If the migration job enters the InError state, the migration fails. You can check the logs to troubleshoot the failure. Then, restart the migration task. For more information about common issues and troubleshooting, see FAQ and Troubleshoot operating system migration failures (Linux)

      If you want to roll back the system disk on which the source operating system is installed, you can use the snapshots that are automatically created for the system disk. To roll back the system disk, perform the following steps:

      1. Log on to the ECS console.

      2. In the left-side navigation pane, choose Storage & Snapshots > Snapshots.

      3. On the Disk Snapshots tab, find the snapshot that you want to use to roll back the system disk, and click Roll Back Disk in the Actions column.

      4. In the Roll Back Disk message, click OK.