Help Center/ Migration Center/ Best Practices/ Server Migration/ Migrating On-premises Servers to Huawei Cloud
Updated on 2026-10-27 GMT+08:00

Migrating On-premises Servers to Huawei Cloud

Scenario

This section describes how to use MgC to migrate on-premises servers to Huawei Cloud.

Preparations

Prepare a Windows server for installing the MgC Agent in the source intranet environment. The Windows server must:
  • Run Windows Server 2016, Windows Server 2019, Windows Server 2022, Windows 10, or Windows 11.
  • Use PowerShell 3.0 or later.
  • Have at least 4 CPUs and 8 GB of memory.
  • Have at least 20 GB of available space on the drive (drive C by default) for installing the MgC Agent.
  • Be able to access the Internet and the domain names of MgC, IoTDA, and other cloud services. For details about the domain names to be accessed, see Domain Names.
  • Allow the ports required by the MgC Agent. For details about the required ports, see Communication Matrix.
  • Allow outbound traffic on port 8883 if the server is in a security group.
  • Not have any antivirus or protection software enabled. This type of software may stop the MgC Agent from executing migration commands, resulting in migration failures.

Do not install the MgC Agent on a source server to be migrated.

  • High resource consumption: The MgC Agent consumes CPU and memory resources during collection and migration. If a large number of migration tasks are performed by the MgC Agent, services on the source server may be affected.
  • Port occupation: The MgC Agent occupies some ports on the server, which may affect services running on it.

Prerequisites

Requirements for Source Servers

When the MgC Agent is used to collect data from and migrate source servers, the source servers must meet the requirements below.

Windows source servers must:
  • Allow access from the server where the MgC Agent is installed over port 5985 or 5986.
  • Use PowerShell 3.0 or later.
  • Have WinRM enabled and be able to access the server where the MgC Agent is installed. For more information, see How Do I Configure WinRM and Troubleshoot WinRM Connection Problems?
  • Allow the execution of shell scripts. To review the current execution policy, you can open PowerShell on the source servers as an administrator and run the following command:
    Get-ExecutionPolicy
    If Restricted is returned, no scripts can be executed. Run the following command and enter Y to change the policy to RemoteSigned:
    Set-ExecutionPolicy RemoteSigned
Linux source servers must:
  • Allow access from the server where the MgC Agent is installed over port 22.
  • Allow direct root access. This means remote connections using root with SSH or other tools must be allowed on these Linux source servers.
  • Have SFTP and SSH enabled.
  • Support the following key exchange algorithms and MAC algorithms:
    • Key exchange algorithms: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, rsa-sha2-512, and rsa-sha2-256
    • MAC algorithms: hmac-sha2-256 and hmac-sha2-512

    If a server does not support the preceding security algorithms, you are advised to upgrade OpenSSH to 8.0 or later. Otherwise, deep collection cannot be performed for that server.

  • Have their iptables configured to allow all communications with the server where the MgC Agent is installed. To verify that, you can run the following command on the source servers. If the source field in the command output contains the IP address and port of the server where the MgC Agent is installed, the MgC Agent is not allowed to access these source servers. In this case, you need to allow access from the MgC Agent.
    iptables -L INPUT -v -n

    Run the following command to allow access.
    iptables -D INPUT -s <IP-address-of-the-MgC-Agent-server-indicated-by-the-source-field>

Precautions

Before creating a server migration workflow, read and understand the items below.

Item

Remarks

Source download bandwidth

Used to download the SMS-Agent to source servers.

  • If each source server uses a dedicated bandwidth, the bandwidth must be at least 30 Mbit/s.
  • If source servers share a bandwidth, the average bandwidth must be at least 50 Mbit/s.

Migration bandwidth

Available CPUs and memory

  • Memory: at least 520 MB
  • CPU: at least 0.3 CPUs in Linux and 1 CPU in Windows

OS compatibility

For details, see Supported OSs.

Server migration statements

For details about the important statements you need to understand before the migration, see What Are the Important Statements of SMS?

Constraints

For details about the notes and constraints for server migration, see Notes and Constraints.

Billing

For details about the costs that may be incurred during the migration, see Billing.

Permissions configuration

IAM is used for fine-grained permissions management. For details, see Permissions Management.

Migration network and ports

For details about the requirements for the migration network and ports, see How Do I Set Up a Secure Migration Network for Using SMS?

Changes in server configurations before and after migration

For details about the configurations that may change after the migration, see What Are the Differences Between the Source and Target Servers After the Migration?

Step 1: Install the MgC Agent

Install the MgC Agent on the prepared Windows server in the source network, connect it to the MgC console, and add the source server credentials for migration. The procedure is as follows.

Step 2: Adding Source Servers

  1. Sign in to the MgC console. In the navigation pane, under Project, select your application migration project from the drop-down list.
  2. In the navigation pane, click Resource Survey.
  3. On the Servers tab, click Add above the list.

    Figure 2 Adding a server

  4. In the displayed dialog box, configure parameters based on Table 2 and click Confirm. The system automatically checks the credential status and starts collecting resource details.

    Table 2 Parameters for adding a server

    Parameter

    Description

    Name

    User-defined

    MgC Agent

    Select the MgC Agent installed in the source environment.

    Type

    Select the OS type of the source server.

    Access IP Address

    Enter the IP address of the source server.

    If the source server is in the same VPC as the MgC Agent, you can enter the private IP address of the server. Otherwise, you have to enter its public IP address.

    Port

    Enter the port on the source server that allows access from the MgC Agent.

    • The port defaults to 5985 on Windows and can be modified.
    • The port defaults to 22 on Linux and can be modified.

    Credential

    Select the server credential. If the credential is not displayed in the list, go to the MgC Agent console, add the server credential, and synchronize it to MgC.

    Whether to check migration items

    Decide whether to select the checkbox I authorize MgC to collect and save the raw data for later analysis. Selecting it helps identify risks beforehand.

    • Deselected: MgC only performs deep collection.
    • Selected: MgC performs deep collection and identifies dependency risks. Click a server name to check the analysis result on the resource details page.

  5. After the server is added, view it in the list. When Collected shows up in the Deep Collection column and you have authorized MgC to gather raw migration command results, click the server name and view the command execution results on the Migration Commands tab.

Step 3: Create a Migration Task

  1. Sign in to the MgC console. In the navigation pane, under Project, select your application migration project from the drop-down list.
  2. In the navigation pane, choose Server Migration > Bulk Servers.
  3. Click Create Migration Task.
  4. Use the default task name or create one. Enter the task description (optional).
  5. Click OK to complete the task creation.

Step 4: Configure the Migration Task

This step includes five phases.

Step 5: Track the Migration Task

In the migration task list, click the task name to go to the Task Details page. Check the task progress and perform the following operations on it.
Table 8 Operations related to resources

Scenario

Operation

Checking migration details

Click a resource name. On the Resource Details page displayed on the right, check the basic information, migration status, and migration progress.

Checking a target server

After the step CreateTargetServer is completed for a resource, choose More > View Target Resource in the Operation column to review details about the target server.

Checking an SMS task

After the step StartUpAgent is completed for a resource, a migration task is automatically created on the SMS console. To check the details on the SMS task, click View Migration Task in the Operation column.

Resizing disks and partitions

When the workflow on a resource reaches the ResizeDiskPartition step, the system identifies whether the target server's disk capacity has been reduced.
  • If yes, go to the SMS console and resize disks and partitions for the target server. For details, see the Resize Disks and Partitions parameter in Configuring a Target Server. After the adjustment is complete, return to the task details page and choose More > Confirm in the Operation column to continue the migration.
  • If no, choose More > Skip in the Operation column to skip this step and proceed with the subsequent migration steps.

Pausing a resource migration

You can pause the migration of a single resource in a migration task.

During the migration, when the resource reaches the full or incremental replication step, you can click Pause in the Operation column to pause the migration of the resource.

To resume the migration, click Run in the Operation column.

NOTICE:

After the migration of a resource is paused, do not perform any operations on the corresponding migration task on the SMS console.

Repeating incremental synchronization

The StartSynchronization step can be repeated. When a resource reaches the BusinessValidation step and the resource status is Not confirmed, select the resource and click Run Previous Step above the resource list. Alternatively, choose More > Run Previous Step in the Operation column of the resource to repeat incremental synchronization.

CAUTION:

You are not advised to perform incremental synchronization on the SMS console. Otherwise, the migration task status on the MgC console may differ from that on the SMS console, causing abnormal task running.

Verifying services

When the workflow on a resource reaches the BusinessValidation step and there is no more incremental synchronization, verify services on the target server. After services pass the verification, click Confirm in the Operation column of the corresponding resource to enter the Complete cutover stage.

Switching traffic

The workflow moving to the Cutover step means that the target server has been verified and you can transfer services to the target server. After the switchover is complete, return to the task details page and click Confirm in the Operation column. The system automatically performs the subsequent SourceClear and MigrationTaskClear steps.

Step 6: Verify Services

When the migration task reaches the service verification step for a server resource, log in to the target server to verify data consistency with the source server and start services to ensure proper operation. After completing verification, click Confirm in the Operation column of the server resource to proceed to the migration cutover phase.

  1. Log in to the target server using Virtual Network Computing (VNC). References:

    The username and password for logging in to the target server are the same as those of the source server.

  2. Check whether the file list of the source server is the same as that of the target server.
  3. Start the applications or services on the target server and check whether they are running properly.

Step 7: Perform a Service Cutover

MgC does not provide the service cutover function.

When the migration reaches the service cutover step, services on the target server have been verified. At this point, you can redirect the service access layer to the target server to resume user services. The cutover mode varies with the application scope:

  • One-off cutover: for small and medium-sized services
  • Batch cutover: for large-scale services. Different from one-off cutover, this mode groups servers based on their complexity, and then migrates each batch at a time.