All Products
Search
Document Center

Server Migration Center:Migrate a Windows operating system

Last Updated:Aug 15, 2024

Microsoft has stopped providing technical support for outdated operating systems such as Windows Server 2008 R2. For security or business reasons, you must migrate Windows Server 2008 R2 or later to a later version. This topic describes how to use Server Migration Center (SMC) to migrate a Windows operating system of an Elastic Compute Service (ECS) instance.

Scenarios

The following table describes the x86-based operating systems that can be migrated by using SMC and the operating systems that can serve as migration destinations.

Operating system architecture

Source operating system

Destination operating system

x86

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

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

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

Important

The language of the destination operating system must be the same as that of the source operating system.

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

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

Important

The language of the destination operating system must be the same as that of the source operating system.

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

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

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

Important

The language of the destination operating system must be the same as that of the source operating system.

Limits

  • Cross-language migration of Windows operating systems is not supported.

  • The ECS instance whose Windows operating system is to be migrated must have at least 2 vCPUs and 2 GiB of memory.

  • The migration tool consumes resources to download and install software packages during the migration process. Therefore, make sure that the available space of the C drive on the instance is at least 20 GiB, and the available space is larger than the size of the C:\Windows directory.

Usage notes

  • Before you migrate the operating system, we recommend that you test and verify that all your business applications are compatible with the destination operating system and run as expected in the destination operating system to ensure business continuity and functionality.

  • During the migration, 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. To prevent the preceding operations from affecting your business, we recommend that you back up important data and plan an appropriate migration timeframe.

  • If you perform a migration test or cancel a migration job, all disks of the ECS instance may be automatically rolled back to the snapshots that are created before the migration. In this case, the data generated during the migration is lost. Before the migration job is complete, we recommend that you do not use the ECS instance.

  • During the migration, the system automatically shares the snapshot of the Windows installation media with the current Alibaba Cloud account, and uses the snapshot to create and attach an intermediate disk to the instance. Do not perform operations on the intermediate disk during the migration. After the migration is complete, the intermediate disk is automatically detached and released.

  • Before and during the migration, the system checks whether the source instance meets the required conditions and prechecks the migration job. If the source instance does not meet the required conditions or fails to pass the precheck, errors occur during the migration and the migration job fails. We recommend that you familiarize yourself with the migration limits and FAQ documents and perform migration tests. For more information, see Errors occurred during the migration of a Windows operating system.

  • During the migration, the operating system kernel and software packages are installed or updated and the operating system is automatically restarted multiple times. In this process, business continuity cannot be ensured. We recommend that you assess the impact of migration on your business and suspend your business before you perform a migration job. We also recommend that you do not use the source operating system during the migration.

Billing

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

Prerequisites

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

  • The ECS instance is deployed in a virtual private cloud (VPC). If the ECS instance is in the classic network, you must migrate the ECS instance from the classic network to a VPC. For more information, see Migrate ECS instances from the classic network to a VPC.

  • Snapshots are created for the source operating system and data for backup, so that you can restore the source operating system and data if necessary. For more information, see Create a snapshot for a disk.

    Important

    If you migrate an operating system, the operating system kernel, software packages, and configurations are modified. The modifications are irreversible.

    The Delete Automatic Snapshots While Releasing Disk feature is manually disabled if you want to retain the snapshots that are associated with the original system disk. After the migration, the original system disk is released and the associated snapshots are also released by default. For more information, see Delete automatic snapshots while releasing a disk.

Procedure

(Recommended) Fast migration

Note

To use the SMC console to import the information about a migration source, make sure that the following conditions are met:

  • Internet access is enabled for the migration source.

  • 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 about a migration source as a Resource Access Management (RAM) user, make sure that the following permissions are granted to the RAM user:

    • AliyunRAMReadOnlyAccess. For more information, see Grant permissions to a 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 RAM overview.

  1. Log on to the SMC console.

  2. In the left-side navigation pane, choose Cloud Migration > OS Migration.

  3. On the OS Migration page, click Upgrade Operating System.

  4. In the Operating System Migration dialog box, configure the parameters that are described in the following table.

    Parameter

    Description

    Example

    Select Migration Source

    Select the region of the ECS instance whose operating system you want to migrate and the ID or name of the ECS instance from the drop-down lists.

    • Region: China (Hangzhou)

    • Instance ID and name: i-2ze4looqfx**** and test

    Current Operating System

    By default, the current operating system is displayed and cannot be modified.

    Windows Server 2012 R2 Datacenter 64-bit (Simplified Chinese)

    Destination Operating System

    Select the operating system to which you want to migrate the source operating system from the drop-down list.

    Windows Server 2016 R2 Datacenter 64-bit (Simplified Chinese)

  5. Select I acknowledge and accept these risks and authorize Alibaba Cloud to create snapshots for all disks on the instance and click Create.

  6. In the Migrate Operating System dialog box, read the messages and click Got It.

  7. In the Create Migration Job dialog box, click Go to the Migration Jobs page and wait until the migration job is complete.

    Warning

    During the migration, do not stop, restart, or release the Windows ECS instance manually or by using O&M scripts.

Staged migration

Step 1: Import the information about a migration source

Migration sources can be servers of a variety of types, 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 select the method to import the information about a migration source? section of the "FAQ" topic.

(Recommended) Import the information about a migration source by using the CLI

Important

The source server must be accessible over the Internet.

  1. Log on to the SMC console.

  2. In the left-side navigation pane, choose Cloud Migration > OS Migration.

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

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

    Parameter

    Description

    Migration Source Type

    The type of the migration source. Select ECS.

    Import Method

    The method that is used to import the information about the migration source. Select Use CLI to Import Server.

    Migration Source Quota

    The number of migration sources whose information you want to import by using the activation code. Valid values: 1 to 1000. Default value: 10.

    Validity Period

    The validity period of the activation code. Unit: day. Valid values: 1 to 90. Default value: 30.

    Activation Code

    Generate the activation code and copy the generated command by performing the following steps:

    1. Click Generate.

    2. Click the Windows Powershell tab.

    3. Click Copy to copy the activation code command.

  5. Import the information about the migration source.

    1. Log on to the Windows server.

    2. Open Windows PowerShell as an administrator.

    3. Run the copied command to import the information about the migration source.

      image.png

      After the command is run, if a message similar to Import Source Server [s-bp19rlidl3mwuptc****] Successfully! is returned, the information about the migration source is imported.

  6. 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 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 issue based on the message displayed in the SMC console or the log file in the directory where the SMC client is installed. By default, the SMC client is installed in the C:\smc directory.

      • Refer to the FAQ and Troubleshooting topics for troubleshooting.

Import the information about a migration source by using the SMC console

Note

To use the SMC console to import the information about a migration source, make sure that the following conditions are met:

  • Internet access is enabled for the migration source.

  • 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 about a migration source as a Resource Access Management (RAM) user, make sure that the following permissions are granted to the RAM user:

    • AliyunRAMReadOnlyAccess. For more information, see Grant permissions to a 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 RAM overview.

  1. Log on to the SMC console.

  2. In the left-side navigation pane, choose Cloud Migration > OS Migration.

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

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

    Parameter

    Description

    Migration Source Type

    The type of the migration source. Select ECS.

    Import Method

    The method that is used to import the information about the migration source. Select Import through Console.

    Migration Source Name

    The name of the migration source. The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

    OS Type

    The type of the operating system. In this example, Windows is used.

    Important

    If you select Windows as the operating system, you must install OpenSSH on the source server. Otherwise, the information about the migration source fails to be imported. For more information, see the How do I install OpenSSH on a Windows server? section of the "FAQ" topic.

    IP Address

    The IPv4 address that is used to access the migration source over the Internet. Example: 120.55.XX.XX.

    Port

    The SSH port number of the migration source. Valid values: 1 to 65535. Default value: 22.

    Username

    The username that is used to log on to the operating system of the migration source. Default value: Administrator.

    Password

    The password corresponding to the username.

  5. After you configure the parameters, click Import.

    The import process takes about 3 to 10 minutes. Wait until the import is complete.

  6. On the Server Migration page in 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 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 message displayed in the SMC console or the log file in the directory where the SMC client is installed. By default, the SMC client is installed in the following directory:

        • Windows server: C:\smc

        • Linux server: /smc

      • Refer to the FAQ and Troubleshooting topics for troubleshooting.

Import the information about a migration source by using the SMC client

For more information about the SMC client, see Use the Windows GUI version of an SMC client.

  1. Log on to the SMC console.

  2. In the left-side navigation pane, choose Cloud Migration > OS Migration.

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

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

    Parameter

    Description

    Migration Source Type

    The type of the migration source. Select ECS.

    Import Method

    The method that is used to import the information about the migration source. Select Use Client to Import Server.

    Description

    Read the information in the Description section and download the required version of the SMC client based on the CPU architecture (Arm or x86) and bit version (32-bit or 64-bit) of the operating system of the migration source.

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

    2. On the source Windows server, use the built-in decompression tool of Windows or the decompression tool that you install to decompress the SMC client package.

    3. In the SMC client folder that corresponds to the source server, run the SMC client.

      • To run the Windows GUI version, double-click the go2aliyun_gui.exe file.

      • To run the Windows CLI version, double-click the go2aliyun_client.exe file.

      Note

      When you run the program, you must click OK to confirm that you have the administrator permissions.

    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. Enter the activation code or AccessKey pair as prompted.

      • To run the Windows GUI version, enter the activation code or AccessKey pair in the Token Id/AK and Token Code/SK fields and click Start. For more information, see Use the Windows GUI version of an SMC client.

      • To run the Windows CLI version, enter the obtained access_access_token_id and access_token_code and press the Enter key.

      If the information about the migration source is imported, a message similar to the following one is returned: Import Source Server [s-bp11npxndknsycqj****] Successfully!

  6. 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 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 issue based on the message displayed in the SMC console or the log file in the directory where the SMC client is installed. By default, the SMC client is installed in the C:\smc directory.

      • Refer to the FAQ and Troubleshooting topics for troubleshooting.

Step 2: Create a migration job

  1. Find the migration source that you want to manage, click Create Migration Job in the Actions column.

  2. In the Create Migration Job dialog box, configure the parameters and click Create.

    You can configure the following parameters to create an operating system migration job:

    • Current Operating System: By default, the current operating system is displayed and cannot be modified. Example: Windows Server 2008 R2 64-bit (Simplified Chinese).

    • Destination Operating System: Select the operating system to which you want to migrate the source operating system from the drop-down list. In this example, Windows Server 2012 R2 Datacenter 64-bit (Simplified Chinese) is used.

  3. In the Migrate Operating System dialog box, read the messages and click Got It.

  4. In the Create Migration Job dialog box, click Go to the Migration Jobs page and wait until the migration job is complete.

    Warning

    During the migration, do not stop, restart, or release the Windows ECS instance manually or by using O&M scripts.

Verify the migration result

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

    image

    Note

    After the migration job is complete, the ECS instance automatically restarts. During the system initialization, operations such as software package updates are performed. Do not perform operations on the ECS instance until the operating system starts. The system initialization takes about 10 minutes. The actual time varies based on the number of system software packages to be processed.

    On the Operating System Migration tab of the SMC console, find the migration job and click View Destination Instance in the Actions column. In the Configuration Information section of the Instance Details tab of the ECS instance, verify that the source operating system is migrated to the destination operating system.

    image.png

    Important

    After the migration is complete, the operating system kernel and software packages of the source operating system are upgraded. Original application data is retained. However, your applications may not run as expected due to changes in the environment or dependencies. In this case, business cannot run as expected. Therefore, you must test and verify a migration solution before you perform a migration job.

  • If the state of the migration job changes to Error, the migration job fails.

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

    1. Click Troubleshoot Errors in the Actions column and fix the failure based on the error code and error message. For more information, see FAQ and Troubleshooting.

    2. On the Migration Jobs page, click Retry 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 release an intermediate instance by accident? section of the "FAQ" topic.

    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 of the Snapshots page, find the snapshot that you want to use to roll back the system disk, and click Roll Back Disk in the Actions column.

      image

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

Clear resources

During the migration, SMC creates two pay-as-you-go snapshots named SMC_Backup_Snapshot_XXX and SMC_Transition_Snapshot_XXX for disks of the ECS instance for backup and data transfer. The method of clearing the snapshots depends on whether the migration is successful.

  • If the migration is successful, the snapshots are automatically released. No manual operation is required.

  • If the migration fails, the snapshots are not automatically released and incur fees as long as the migration job exists. You can release the snapshots by using one of the following methods to reduce costs:

    • If you no longer need the migration job, move the pointer over the image icon in the Actions column and select Delete to delete the migration job and release the snapshots at a time.

    • Manually delete the snapshots. For more information, see Delete a snapshot.