All Products
Search
Document Center

Elastic Compute Service:OS migration and upgrade

Last Updated:May 13, 2026

This feature lets you replace or upgrade the operating system of your ECS instance, ensuring stable maintenance and support while retaining data on the system disk.

Use cases

When the operating system on your ECS instance reaches its end of life (EOL), you may face increased security and operational risks. We recommend replacing the EOL operating system as soon as possible. The OS migration feature lets you retain application data after the replacement, but it only supports a limited number of OS migration options.

If you do not need to retain the data on your system disk or if you require more OS options, replace the system disk to change the operating system. You can also refer to the Operating system maintenance cycle and EOL guidance for recommended migration plans and detailed procedures for your current operating system.

Pre-migration assessment

Before starting the migration, understand the limitations of the destination operating system and conduct comprehensive testing to validate all your business applications in the target environment. This ensures compatibility and performance and prevents potential issues like service disruptions or feature failures after the migration.

The OS migration tool does not support hot migration. During the migration, the source instance's system kernel and software packages are installed or updated, and the instance restarts multiple times, causing service interruptions. Therefore, before you begin, manually create a snapshot to back up your data and isolate the migration environment to avoid affecting your production workload.

Source operating system is Windows

Limitations

Important

Before you migrate the operating system, understand the following limitations.

  • Cross-language migration for Windows is not supported.

  • Only specific migration paths are supported.

  • The source Windows ECS instance must have an instance type with at least 2 vCPUs and 2 GiB of memory.

  • The operating system migration tool consumes resources to download and install software packages. Before you start the migration, ensure the instance's C drive has at least 20 GiB of free space. This amount must be greater than the size of the C:\Windows directory.

  • You cannot migrate an ECS instance while a snapshot is in progress. Wait for the snapshot to complete before starting the migration.

  • Windows operating system migration is supported only in the following regions.

    Asia Pacific - China

    Asia Pacific - Other

    Europe & Americas

    Middle East

    • China (Hangzhou)

    • China (Shanghai)

    • China (Qingdao)

    • China (Beijing)

    • China (Zhangjiakou)

    • China (Hohhot)

    • China (Ulanqab)

    • China (Shenzhen)

    • China (Heyuan)

    • China (Guangzhou)

    • China (Chengdu)

    • China (Hong Kong)

    • China (Wuhan-Local Region)

    • Japan (Tokyo)

    • South Korea (Seoul)

    • Singapore

    • Malaysia (Kuala Lumpur)

    • Indonesia (Jakarta)

    • Philippines (Manila)

    • Thailand (Bangkok)

    • Germany (Frankfurt)

    • UK (London)

    • US (Silicon Valley)

    • US (Virginia)

    Saudi Arabia (Riyadh)

Supported OS for migration

The ECS OS migration feature supports migrating your instance to the following operating systems.

Windows Server 2008 R2

Windows Server 2008 R2 has reached its EOL. You can migrate your workloads to Windows Server 2016 or 2019, which are in mainstream support.

Important

Windows migration limitations prevent a direct migration from Windows Server 2008 R2 to Windows Server 2016 or 2019. You must first migrate to an intermediate version, Windows Server 2012 R2.

  1. Migrate Windows Server 2008 R2 to the intermediate version, Windows Server 2012 R2.

    OS architecture

    Source operating system

    Destination operating system

    x86

    Windows Server 2008 R2 Standard Edition 64-bit (Chinese/English)

    Windows Server 2012 R2 Datacenter Edition 64-bit (Chinese/English)

    Windows Server 2008 R2 Enterprise Edition 64-bit (Chinese/English)

  2. Migrate Windows Server 2012 R2 to Windows Server 2016 or 2019.

    OS architecture

    Source operating system

    Destination operating system

    x86

    Windows Server 2012 R2 Datacenter Edition 64-bit (Chinese/English)

    • Windows Server 2016 Datacenter Edition 64-bit (Chinese/English)

    • Windows Server 2019 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2012 R2

Windows Server 2012 R2 has reached its EOL. You can migrate your workloads to Windows Server 2016 or 2019, which are in mainstream support.

OS architecture

Source operating system

Destination operating system

x86

Windows Server 2012 R2 Standard Edition 64-bit (Chinese/English)

  • Windows Server 2016 Datacenter Edition 64-bit (Chinese/English)

  • Windows Server 2019 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2012 R2 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2016

OS architecture

Source operating system

Destination operating system

x86

Windows Server 2016 Standard Edition 64-bit (Chinese/English)

  • Windows Server 2019 Datacenter Edition 64-bit (Chinese/English)

  • Windows Server 2022 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2016 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2019

OS architecture

Source operating system

Destination operating system

x86

Windows Server 2019 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2022 Datacenter Edition 64-bit (Chinese/English)

Source operating system is Linux

Limitations

Important

Before you migrate the operating system, understand the following limitations.

Category

Description

General limitations

  • Anolis OS and Alibaba Cloud Linux do not provide i686-architecture software packages. If your system has CentOS software packages of the i386 architecture (including i686) installed, the migration will fail.

  • The OS migration tool downloads and installs software packages, which consumes resources. Before the migration, make sure that your instance has the following resources available:

    • Memory: 600 MiB

    • Cloud 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 compute resources (vCPUs and memory) or storage resources (system disk and data disks), we recommend stopping workloads on the instance before the OS migration. This helps prevent migration failures caused by insufficient resources.

Kernel compatibility limitations for migrating CentOS 7/8 to Alibaba Cloud Linux

The following compatibility limitations exist between CentOS 7/8 and Alibaba Cloud Linux. If your workload relies on kernel API programming (for example, out-of-tree kernel module development or hardware enablement), perform a thorough migration assessment to prevent workload failures after the migration.

Category

Description

Migrating from 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.

Migrating from CentOS 7 to Alibaba Cloud Linux 3

CentOS 7 uses kernel 3.10. Alibaba Cloud Linux 3 uses Linux kernel 5.10 LTS and a base toolchain of GCC 10.2, binutils 2.35, and glibc 2.32. The two kernel versions are not compatible.

Migrating from CentOS 8 to Alibaba Cloud Linux 3

Alibaba Cloud Linux 3 uses Linux kernel 5.10 LTS and a base toolchain of GCC 10.2, binutils 2.35, and glibc 2.32. Its software package ecosystem is compatible with CentOS 8. The OS migration tool performs a basic check on the source operating system, but you must still perform your own assessment to prevent workload failures after migration.

You also need to be aware of the following migration limitations related to specific OS features or software:

Feature or software

Support status

Impact on migration

Description

i386-architecture software packages

Not supported

Yes

Alibaba Cloud Linux does not provide i386-architecture software packages. If your system contains such packages, you cannot use the migration tool. Remove these packages before the migration to prevent system errors.

epel-modular

Not supported

No

The platform dependencies for the EPEL repository in CentOS 7/8 differ from those in Alibaba Cloud Linux 3. After migration, you cannot install epel-modular-based software packages.

C/C++ program compatibility

Not guaranteed

No

Alibaba Cloud Linux 3 uses a base toolchain with GCC 10.2, binutils 2.35, and glibc 2.32. Its system packages are pre-compiled for compatibility. After the OS migration, we recommend that you recompile and validate your C/C++ programs against the new base toolchain to avoid compatibility issues.

MySQL database

Only migration to the same or a higher version of MySQL is supported.

  • No impact if you migrate to the same or a higher MySQL version.

  • Migration is affected if you migrate to a lower MySQL version.

Alibaba Cloud Linux 3 supports MySQL databases. However, MySQL does not support version downgrades. If the MySQL version available on Alibaba Cloud Linux 3 is lower than the version on the source CentOS 7/8 system, the OS migration is not supported.

Supported OS for migration

The ECS OS migration feature supports migrating your instance to the following operating systems.

CentOS 7/8

Architecture

Source

Destination

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

    Migration from CentOS 7.9 to Red Hat 7 is available only to select users. To use this feature, .

CentOS 8.x

  • AnolisOS 8

  • Alibaba Cloud Linux 3

  • Red Hat 8

    Note

    Migration from CentOS 8.5 to Red Hat 8 is available only to select users. To use this feature, .

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

Architecture

Source

Destination

x86

Red Hat 7.9

  • Alibaba Cloud Linux 3

  • Red Hat 8

    Note

    You cannot specify a minor version for the destination Red Hat operating system.

Red Hat 8.x

  • Red Hat 9

    Note

    You cannot specify a minor version for the destination Red Hat operating system.

  • Alibaba Cloud Linux 3

Alibaba Cloud Linux 2

Architecture

Source

Destination

x86

Alibaba Cloud Linux 2

Alibaba Cloud Linux 3

Prerequisites

  • Ensure that Resource Access Management (RAM) is activated and authorized.

    If it is not authorized, log on to the RAM console and click Authorize.

    Note

    If you are using a RAM user, log on to the RAM console with your primary account and grant the AliyunSMCFullAccess permission to the RAM user.

  • Ensure that the snapshot service is activated. The system creates a snapshot of the ECS instance during migration. For more information, see Activate ECS Snapshot.

  • Ensure that the ECS instance is in the Running state, the Cloud Assistant Agent is installed and has been active within the last 24 hours. If it is not installed, see Install the Cloud Assistant Agent.

Procedure

Warning
  • During the migration, the system creates snapshots of basic cloud disks, converts the OS kernel version, reinstalls and upgrades software packages, and stops and starts the ECS instance. We recommend that you back up important data and schedule the migration during a maintenance window to minimize business impact.

  • Do not manually stop, restart, or release the ECS instance or use scripts to perform these operations during the migration. Otherwise, the migration may fail.

  • Performing a migration drill or canceling a migration may trigger an automatic rollback to the pre-migration snapshot. Data generated during the migration will be lost.

  • During a Windows migration, a snapshot of the Windows installation media is automatically shared with your Alibaba Cloud account. A transit cloud disk is created from this snapshot and attached to the instance. Do not perform any operations on this transit cloud disk. It is automatically detached and released after the migration is complete.

  • The system checks migration conditions and performs a pre-assessment on the source instance. If the source system does not meet the requirements or if the pre-assessment fails, the migration is interrupted. A successful migration is not guaranteed. We recommend that you familiarize yourself with the migration requirements and troubleshooting documentation and perform a test migration first.

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

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

      Note

      You can reinstall the client after the migration is complete. For more information, see Install the client.

      1. Go to the Alibaba Cloud Security Center client uninstallation page and select the target instance. 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

        A return message of Uninstall Success indicates that the Security Center client has been successfully uninstalled.

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

      CentOS 7

      # Back up the original yum repo and update to the Alibaba Cloud CentOS 7 repo.
      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 repo and update to the Alibaba Cloud CentOS 8 repo.
      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. Start the OS migration process.

    1. Go to ECS console - Instances.

    2. In the top navigation bar, select the region where the target ECS instance is located.image.png

    3. Click the ID of the target instance to go to its details page. Click All Operations to expand the operations panel, then search for and click Replace System Disk.

  3. Select OS Migration. The system automatically performs a pre-migration check, which takes about 10 seconds. The check passes when the status changes from image to image.

  1. Carefully read the OS migration notes, select I have read and understood the risks, and I agree to authorize Alibaba Cloud to create snapshots for all cloud disks of this instance, and then click Next.

    Note

    For a batch migration, you must also select the ECS instances to be migrated.

  2. In the Replace System Disk dialog box, select a destination operating system as needed.

    1. Select the Same Destination Operating System: For a batch migration, you can migrate different instances to the same destination operating system.

    2. Select Destination Operating System by Instance: Allows you to select a different destination OS for each instance in a batch migration.

  3. Click Check For Migratability to view the results. The check takes about 30 seconds. After the status shows image, click Confirm Migration.

Migration verification

  1. In the Replace System Disk dialog box, click the instance ID. On the Instance Details tab, check the Instance Status section to verify if the OS migration was successful.

    Note

    The migration takes about 15 to 30 minutes, not including the time to create cloud disk snapshots. During the process, you can hover over Replacing Operating System to view the migration progress.

  1. When the instance status changes from Running (Replacing Operating System) to Running, the OS migration is successful.

    Important

    If the instance status is Running (Operating System Replacement Failed), the OS migration has failed. You can hover over the status to view the cause of the failure. Click Troubleshooting & Contact Us to resolve the issue. After the issue is resolved, click Retry Replacement to attempt the migration again.

  2. After the migration, the instance starts automatically. The instance ID, image ID, VPC, public and private IP addresses, hostname, and machine code remain unchanged. The operating system changes to the destination OS. The original system disk data is preserved, but applications may not work correctly due to environment or dependency changes. Perform thorough testing and verification. To revert to the source system, use the automatically created snapshot to roll back the cloud disk.

Next steps