Operating system migration (Windows)

Updated at:
Copy as MD

If your operating system (OS) has reached its End of Life (EOL) or you need to upgrade to a higher version to meet business requirements, you can use Server Migration Center (SMC) to migrate your OS in-place. This process retains the data on the system disk of your ECS instance. This topic describes how to migrate Windows Server 2008 R2, 2012 R2, 2016, or 2019 to a higher version by using SMC.

Background

Microsoft ended support for Windows Server 2008 and 2008 R2 on January 14, 2020, and for Windows Server 2012 and 2012 R2 on October 10, 2023. If you have ECS instances that run these operating systems, we recommend that you upgrade them to continue receiving software updates and security patches to avoid issues related to EOL. For more information, see Windows Server operating systems. The OS migration feature of Server Migration Center (SMC) provides several migration paths. After the migration, the OS kernel and major system software packages are upgraded in place, and the data on the system disk is retained.

Note

If you do not need to retain data on the system disk or need more OS conversion options, you can replace the system disk to change the OS.

Migration paths

Windows Server 2008 R2

Windows Server 2008 R2 is no longer supported. You can migrate your workloads to Windows Server 2016 or 2019, which are in the mainstream support phase.

Important

Due to limitations of the Windows OS migration feature, you cannot directly migrate 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 OS

    Target OS

    x86

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

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

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

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

    OS architecture

    Source OS

    Target OS

    x86

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

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

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

Windows Server 2012 R2

Windows Server 2012 R2 is no longer supported. You can migrate your workloads to Windows Server 2016 or 2019, which are in the mainstream support phase.

OS architecture

Source OS

Target OS

x86

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

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

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

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

Windows Server 2016

OS architecture

Source OS

Target OS

x86

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

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

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

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

Windows Server 2019

OS architecture

Source OS

Target OS

x86

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

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

Limits

  • Cross-language migrations for Windows are not supported.

  • Only specific migration paths are supported.

  • The Windows instance must have at least 2 vCPUs and 2 GiB of memory.

  • The OS migration tool consumes resources by downloading and installing software packages. Before you start a migration, ensure the instance's C drive has at least 20 GiB of free space, and that the amount of free space is greater than the size of the C:\Windows directory.

  • You cannot migrate an OS while a snapshot is being created for the instance. Wait for the snapshot creation to finish before starting the migration.

  • Windows OS migration is supported only in the following regions.

    Asia Pacific - China

    Asia Pacific - Other

    Europe and 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)

Precautions

Important

Before you migrate an OS, review the following precautions.

Migration stage

Precautions

Before migration

  • Complete the preparations. For more information, see Preparations.

  • Before you start the migration, we strongly recommend that you review the Limits and thoroughly test all your business applications on the target OS to ensure compatibility and performance. This helps prevent business disruptions and functional failures.

  • During the migration, the source instance's system kernel and software packages are installed or updated, and the instance automatically restarts multiple times. Your services will be unavailable during this period. We recommend that you assess the potential impact and stop your services before you start the migration.

During migration

  • During the migration, do not stop, restart, or release the ECS instance, either manually or by using O&M scripts. Otherwise, the migration may fail.

  • A migration drill or a migration cancellation may trigger an automatic rollback of the pre-migration snapshot, resulting in the loss of any data generated during the migration.

  • The migration process performs several operations on the ECS instance, such as creating a snapshot, 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 and schedule a suitable migration window in advance to prevent these operations from affecting your business.

  • During the Windows migration process, a snapshot of the Windows installation media is automatically shared with the target Alibaba Cloud account. This snapshot is used to create and attach a temporary cloud disk to the instance. Do not perform any operations on this cloud disk during the migration. After the migration is complete, this temporary cloud disk is automatically detached and released.

  • During the migration, the system performs a migration condition check and a pre-assessment on the source instance. If the source system does not meet the migration conditions or the pre-assessment fails, the migration will be interrupted by an error. A successful migration cannot be guaranteed. We recommend that you familiarize yourself with the migration conditions and troubleshooting documentation, and perform tests in advance. For migration issues, see Operating system migration issues (Windows).

After migration

  • After the migration, the instance automatically starts. The instance ID, image ID, VPC, public and private IP addresses, hostname, and machine fingerprint remain unchanged. The operating system of the instance is changed to the target operating system.

  • The data on the original system disk remains unchanged, but your applications may not run properly due to changes in the environment or dependencies. This may cause your services to fail. Therefore, you must perform thorough testing and verification.

Migration operations

Important

During the migration, the system creates snapshots of all cloud disks on the ECS instance to back up data. These snapshots are billed on a pay-as-you-go basis. For more information, see Billing.

Quick migration (Recommended)

Note

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

  1. Go to the Operating System Migration page in the SMC console.

  2. On the OS Migration page, click Start Migration.

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

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

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

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

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

  7. Click Check Migratability to view the migration check result.

    The check takes about 30 seconds.

    • image: The operating system can be migrated.

    • image: The operating system cannot be migrated. Follow the on-screen instructions to view the reason.

  8. Click Migrate.

    View the progress of the operating system migration on the OS Migration page.

    Warning

    During 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 the migration source

A migration source is a physical server, VM, or instance from another cloud platform that you want to migrate.

Import a migration source with one click using the command line (Recommended)

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.

  1. Go to the Operating System Migration page in the SMC console.

  2. On the OS Migration page, click Import Source Servers.

  3. Configure the parameters as prompted and copy the activation code command. The following table describes the parameters.

    Parameter

    Description

    Migration Source Type

    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:

    1. Click Generate.

    2. Click the Windows PowerShell tab.

    3. Click Copy to copy the activation code command.

  4. Import the migration source.

    1. Log on to the Windows source server.

    2. Open Windows PowerShell with administrator privileges.

    3. Paste and run the copied command to import the migration source.

      $(New-Object System.Net.WebClient).DownloadFile('https://p2v-tools.oss-cn-hangzhou.aliyuncs.com/smc/China_Mainland/run_smc_client.ps1', 'run_smc_client.ps1'); .\run_smc_client.ps1 -accesstokenid at-bp1bq****94dnpodl1cm -accesstokencode xxxxxx

      If you receive a message similar to Import Source Server [s-bp19rlidl3mwuptc****] Successfully!, the migration source has been successfully imported.

      If the command fails to run, see What do I do if a command fails to run when I import a Windows migration source by using the command line?.
  5. On the OS Migration page of the SMC console, check 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 using console error messages or log files in the SMC client directory (default: C:\smc).

      • For information about common issues and solutions, see SMC FAQ and Troubleshooting.

Import a migration source using the SMC client

For more information about the SMC client, see SMC client guide.

  1. Go to the Operating System Migration page in the SMC console.

  2. On the OS Migration page, click Import Source Servers.

  3. On the Import Migration Source page, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Migration Source Type

    ECS Instance

    Import Method

    Select Use Client to Import Server.

    Description

    Under Description, download the corresponding SMC client based on the operating system (Linux or Windows) and architecture (32-bit or 64-bit) of the source server.

  4. Import the migration source.

    Important

    Do not close the SMC client during the migration. Otherwise, the migration source loses its connection to the SMC console and the migration fails.

    1. Use a remote connection tool that supports file transfer, such as WinSCP, to upload the SMC client to the Windows source server.

    2. On the Windows source server, use the system's built-in decompression tool or a third-party tool to decompress the SMC client package.

    3. In the folder for the SMC client version that matches your server's system, double-click the go2aliyun_client.exe application.

      When prompted for administrator privileges, click OK.
    4. 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.

    5. As prompted, enter the values for access_token_id and access_token_code, and then press Enter.

      When you receive a message similar to Import Source Server [s-bp18x8751kgz2oyh****] Successfully!, the migration source has been successfully imported.

  5. On the OS Migration page of the SMC console, check 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 using console error messages or log files in the SMC client directory (default: C:\smc).

      • For information about common issues and solutions, see SMC FAQ and Troubleshooting.

Step 2: Configure the migration

  1. In the Actions column of the migration source that you want to manage, click Start Migration.

  2. In the Migration Settings dialog box that appears, configure the parameters.

    The following section describes the OS migration parameters:

    • Current Operating System: The current operating system is displayed by default and cannot be changed. For example: Windows Server 2008 R2 64-bit (Simplified Chinese).

    • Destination Operating System: Select a destination operating system from the drop-down list. For example: Windows Server 2012 R2 Datacenter 64-bit (Simplified Chinese).

  3. Click Start Migration. In the Migrate Operating System dialog box that appears, carefully read the notes and click I Confirm That I Understand.

  4. On the OS Migration page, check the real-time migration status.

    Warning

    During the OS migration, do not manually stop, restart, or release the Windows instance. Do not use O&M scripts to perform these operations. Otherwise, the OS migration will fail.

Verify the migration result

  • When the migration status is Completed, the operating system migration is successful.

    Note

    After the migration task is complete, the ECS instance automatically restarts to update software packages during system initialization. Do not perform any operations on the ECS instance during this time. Wait for the system to start. The initialization process takes about 15 to 30 minutes, depending on the number of software packages.

    In the Actions column of the target migration source, click View Destination Instance. Then, on the details page of the ECS instance, verify that the operating system has been migrated to the target operating system.

    Important

    After migration, the system kernel and packages are replaced while system disk data is retained. Applications may not function correctly due to environmental or dependency changes. Perform thorough testing and validation.

  • When the Real-time Migration Status is InError, the migration task has failed.

    Troubleshoot the issue and retry the migration:

    1. In the Actions column, click Troubleshoot Errors. Resolve the issue based on the error code and message. For more information, see SMC FAQ and Troubleshooting.

    2. After resolving the issue, click Retry Migration Job in the Actions column. The migration resumes from the point of failure.

      Important

      If the intermediate instance has been released, you must restart the migration. For more information, see What do I do if I accidentally release the intermediate instance?.

    If you need to roll back the data of the source system disk, restore the data from an automatic backup snapshot. The steps are as follows:

    1. Go to the ECS console - Snapshots page.

    2. In the Actions column of the automatic backup snapshot, click Roll Back Cloud Disk.

    3. In the Roll Back Cloud Disk dialog box, click OK.

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.