All Products
Search
Document Center

Server Migration Center:Migrate a Windows operating system

Last Updated:Jul 17, 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 SMC to migrate the operating system of an Alibaba Cloud Windows 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 the migration, we recommend that you test and verify all business applications in the target operating system environment in advance to ensure the compatibility and performance between the applications and the target operating system. This helps you avoid problems that may occur after the migration.

  • 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 disk is created as the new system disk. Automatic snapshots that are released along 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.

  • If you perform a migration drill or cancel a migration process, the system may automatically roll back to the pre-migration snapshot. Data generated during the migration is lost. Do not use the ECS instance until the migration task is complete.

  • During the migration process, the system automatically shares the Windows installation media snapshot 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 and upgrade, the source instance will be checked for migration conditions and pre-evaluated. If the source system does not meet the migration conditions or fails the pre-evaluation, the migration will be interrupted. This does not guarantee that the migration and upgrade will be successful. We recommend that you familiarize yourself with the migration conditions and troubleshooting documents and perform testing. For more information, see Errors occurred during the migration of a Windows operating system.

  • During 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. We also recommend that you do not use the source operating system during migration.

Billing

During the migration, the system creates snapshots for all disks of the ECS instance to back up data. You are charged for the 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 Prepare for migration.

  • The ECS instance must be 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 taken for the source system and data. You can restore the snapshots if necessary. For more information, see Create a snapshot for a disk.

    Important

    The migration will make modifications to the operating system kernel, software packages, and configurations. The modifications are irreversible.

  • After the migration, the original system disk is released, and the associated snapshots are also released by default. If you want to retain the snapshots, you can manually cancel the automatic snapshot release along with the disk. For more information, see Delete automatic snapshots while releasing a disk.

Procedure

Quick Migration (recommend)

Note

To use this method, make sure that the following conditions are met:

  • The source server (the source ECS instance) must have the Internet access capability.

  • Install the Cloud Assistant Agent on the source server. By default, ECS instances created from public images after December 1, 2017 are pre-installed with the Cloud Assistant Agent.

  • If you use a RAM user to import data to a migration source, you must grant the following permissions to the RAM user.

    • You must grant the AliyunRAMReadOnlyAccess permission to the RAM user. For more information, see Attach a custom policy to a RAM user.

    • You must grant the Cloud Assistant management permission AliyunECSAssistantFullAccess to the RAM user. For more information, see RAM RAM.

  1. Log on to the SMC console.

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

  3. In the upper-left corner of the page, click Upgrade Operating System.

  4. In the Upgrade Operating System dialog box, set the parameters.

    Parameter

    Description

    Example

    Select a migration source

    Select the region and ID /name of the ECS instance where the operating system to be migrated resides from the drop-down lists.

    • Region: East China (Hangzhou)

    • Instance ID /Name: i-2ze4looqfx****/test

    Current Operating System

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

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

    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.

    Windows Server 2016 R2 Datacenter Edition 64-bit Chinese Edition

  5. Select I am aware of the preceding risks and agree to authorize Alibaba Cloud to create snapshots for all disks of the instance and click Create.

  6. In the Confirm OS Migration dialog box, read the precautions and click OK.

  7. In the Create Migration Task dialog box, click View Now and wait until the migration task is complete.

    Warning

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

Step-by-step migration

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 migration sources. You can select a method to import migration sources based on your business requirements. For more information, see How do I select a method to import a migration source?

Command line one-click import migration source (recommend)

Important

The source server must have Internet access.

  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: days. 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. Execute the operation to import the migration source.

    1. Log on to the Windows source server.

    2. Open Windows PowerShell with administrator privileges.

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

      image.png

      After the command is executed, a similar Import Source Server [s-bp19rlidl3mwuptc****] Successfully! occurs A message is returned, indicating that the migration source is successfully imported.

  6. On the OS Migration page in the SMC console, view the status of the migration source in the Migration Status column.

    • If the status of the migration source is Online, the migration source is imported.

    • If the migration source is in another state, the migration source fails to be imported. See the following solutions to resolve the issue and then re-import the migration source.

      • Solve the problem by following the error message in the console or by viewing the log file in the directory of the SMC client. The default installation directory of the SMC client is C:\smc.

      • For FAQ and solutions, see SMC FAQ and Troubleshooting.

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

Note

To use this method, make sure that the following conditions are met:

  • The source server (the source ECS instance) must have the Internet access capability.

  • Install the Cloud Assistant Agent on the source server. By default, ECS instances created from public images after December 1, 2017 are pre-installed with the Cloud Assistant Agent.

  • If you use a RAM user to import data to a migration source, you must grant the following permissions to the RAM user.

    • You must grant the AliyunRAMReadOnlyAccess permission to the RAM user. For more information, see Attach a custom policy to a RAM user.

    • You must grant the Cloud Assistant management permission AliyunECSAssistantFullAccess to the RAM user. For more information, see RAM RAM.

  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.

    Data import methods

    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, and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

    Operating system

    Select Windows.

    Important

    The source server must have the OpenSSH service installed. Otherwise, the migration source cannot be imported. For more information, see How do I install OpenSSH on a Windows server?

    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

    Enter the user name of the operating system. The default value is Administrator.

    Password

    Enter the password for the username of the operating system.

  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 Migration Status column.

    • If the status of the migration source is Online, the migration source is imported.

    • If the migration source is in another state, the migration source fails to be imported. See the following solutions to resolve the issue and then re-import the migration source.

      • Solve the problem by following the error message in the console or by viewing the log file in the directory of the SMC client. By default, the SMC client is installed in the following directory:

        • Windows: C:\smc

        • Linux: /smc

      • For FAQ and solutions, see SMC FAQ and Troubleshooting.

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

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

  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. In the Import Migration Source dialog box, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Migration Source Type

    The type of the migration source. Select ECS.

    Data import methods

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

    Description

    After Import Description, download the SMC client based on the architecture (Arm and x86) and 32-bit and 64-bit (64-bit) of the source server operating system.

  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 Windows source server, use the built-in decompression tool of Windows or the decompression tool installed by yourself 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 activation code: In the Import Instructions section of the SMC console, click Generate activation code and copy the activation code information.

      • AccessKey pair: The AccessKey pair consists of an AccessKey ID and an AccessKey secret. If no AccessKey pair is created, create one first. For more information, see Create 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 SMC client tools.

      • Command line version: Enter the activation code access_access_token_id and access_token_code values and press the Enter key.

      If the information about the migration source is imported, the following message appears: Import Source Server [s-bp11npxndknsycqj****] Successfully!

  6. On the OS Migration page in the SMC console, view the status of the migration source in the Migration Status column.

    • If the status of the migration source is Online, the migration source is imported.

    • If the migration source is in another state, the migration source fails to be imported. See the following solutions to resolve the issue and then re-import the migration source.

      • Solve the problem by following the error message in the console or by viewing the log file in the directory of the SMC client. The default installation directory of the SMC client is C:\smc.

      • For FAQ and solutions, see SMC FAQ and Troubleshooting.

Step 2: Create a migration task

  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. In this example, Windows Server 2008 R2 64-bit (Chinese) is displayed.

    • Destination Operating System: the destination of the migration job. 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 (Chinese) is selected.

  3. In the Confirm OS Migration dialog box, read the precautions and click OK.

  4. In the Create Migration Task dialog box, click View Now and wait until the migration task is complete.

    Warning

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

Verify the migration results

  • If the migration status is Completed, the OS is migrated.

    image

    Note

    After the migration task is complete, the ECS instance automatically restarts. You can perform operations such as updating software packages during system initialization. Do not perform operations on the ECS instance until the system starts successfully. The system initialization phase takes about 10 minutes. The actual time varies based on the number of system software packages to be processed.

    Find the source instance and click View Target Instance in the Actions column. In the Configuration Information section of the Instance Details tab, check whether the operating system is migrated to the destination instance.

    image.png

    Important

    After the migration and upgrade, the system of the source instance is upgraded to a new system kernel and software package, and the original application data remains unchanged. However, the application software may not run properly due to changes in the environment or dependencies, resulting in business failure. We recommend that you test and verify this.

  • If Migration Status is Error, the migration task fails.

    In this case, you need to troubleshoot the issue and try again:

    1. In the Actions column, click Troubleshoot Errors and fix the error based on the error code and error message. For more information, see FAQ and Errors occurred during a server migration.

    2. On the Migration Tasks page, click Retry Task.

      The migration task continues at the last completed progress.

      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 need to roll back the data of the source system disk, you can use the snapshots that are automatically created in the snapshot list to restore the data. 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.

Resource cleanup

During migration, SMC creates two pay-as-you-go snapshots named SMC_Backup_Snapshot_XXX and SMC_Transition_Snapshot_XXX for the disks of the ECS instance to back up and transfer data. You need to select whether to manually clean up the snapshot based on whether the migration is successful:

  • Migration successful: The snapshot is automatically released. You do not need to manually clean it up.

  • Migration error: Snapshots always exist with the migration task and incur fees. You can use one of the following methods to release snapshots to avoid unnecessary fees:

    • If you no longer want to use the migration task, choose image > Delete in the Actions column to delete the task.

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