Help Center/ Migration Center/ Best Practices/ Server Migration/ Migrating On-premises Servers to Huawei Cloud
Updated on 2025-10-11 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 (formerly Edge) in the source intranet environment. The Windows server must:
    • Run Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows Server 8.1.
    • 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 (formerly Edge). 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.
  • Prepare a HUAWEI ID or an IAM user that has the permissions to access MgC. For details, see Preparations.
  • Create an application migration project on the MgC console.

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.

If there are Windows source servers to be migrated, these servers must:
  • Allow access from the server where the MgC Agent is installed over port 5985.
  • 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
If there are Linux source servers to be migrated, these servers must:
  • Allow access from the server where the MgC Agent is installed over port 22.
  • Allow direct root access. That 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, it means that 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 the 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 precautions below.

Item

Precaution

Source download bandwidth

Used to download 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

  • Used to migrate data. It affects the migration speed and duration.
  • For details about how to estimate the migration duration, see How Long Does a Migration Take?

CPU and memory requirements

  • At least 520 MB of available memory
  • At least 0.3 CPUs available in Linux and at least 1 CPU available in Windows

OS compatibility

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, see Notes and Constraints.

Billing

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

Permissions configuration

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: Download and Install the MgC Agent

  1. Download and install the MgC Agent.
  2. Connect the MgC Agent to MgC.

Step 2: Add Servers to MgC

  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 Source Resources.
  3. On the Servers tab, click Add above the list.

    Figure 1 Adding a server

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

    Table 1 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.

    Collecting raw migration command results

    NOTE:
    • This option is only available for Linux.
    • This option is only available for manual server addition.

    Determine whether to authorize MgC to collect the raw results of migration commands executed on the server. This data helps identify migration risks in advance.

    • To grant authorization, select "I authorize MgC to gather raw migration command results to help identify potential risks."
    • To decline authorization, leave the option unselected.

  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 Batch Server Migration Plan

  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 Migration Plans (NEW).
  3. Click Create Migration Plan.
  4. Set migration plan parameters based on Table 2.

    Table 2 Parameters for creating a migration plan

    Parameter

    Configuration

    Migration Plan Template

    Select Batch Server Migration.

    Plan Name

    The system assigns a default plan name. You can also specify a plan name.

    Description (Optional)

    Enter a description.

  5. Click Confirm. The migration plan is created, and the page for selecting source resources is displayed.

Step 4: Select the Servers to Be Migrated

  1. On the Select Source Resources page, select Other from the Source Platform drop-down list.
  2. Click Add under Source Servers.

  3. Select the source servers to be migrated together and click Confirm.

    The source servers included in this plan will be migrated using the same migration workflow. The same migration settings, such as the VPC, subnet, and security group settings, will be applied to these source servers.

  4. Click Next to open the Check Migration Readiness page.

Step 5: Check Migration Readiness

  1. Configure server credentials. There are two methods for you to do this.

    The credentials you provide must have sufficient permissions, so the MgC Agent can collect necessary server details. The requirements for server credentials are as follows:

    • Linux: root and its password
    • Windows: administrator and its password
    • Manual addition: You can choose this method if you configure credentials for a small number of servers. For more information, see Adding Resource Credentials.
    • Batch addition: You can choose this method if you configure credentials for a large number of servers.
      1. On the Check Migration Readiness page, click Associate Credentials above the list of servers to be migrated to download the template for configuring credentials in batches. Open the template file, enter the credential information (username and password) of all servers in the current migration plan, and save the file.

      2. Import the saved template file to the MgC Agent you connected to MgC. The system automatically configures the MgC Agent and credentials for the servers.

  2. On the Check Migration Readiness page, in the list of servers to be migrated, click Configure in the MgC Agent column to configure an MgC Agent for each server.
  3. Configure the parameters listed in Table 3.

    Table 3 Parameters for configuring migration readiness check

    Parameter

    Configuration

    OS Type

    Set this parameter based on the source server OS type.

    MgC Agent

    Select the MgC Agent installed in the source environment.

    Access IP Address

    Specify the IP address for accessing the source server. You can specify a public or private IP address. After the migration readiness check is passed, the IP address you specify here will be used for migration.

    Access Port

    Enter the accessible port of the source server. This port is used for deep collection and subsequent migration.

    • The port defaults to 5985 for Windows. You can change it to any port that is accessible on the source server.
    • The port defaults to 22 for Linux. You can change it to any port that is accessible on the source server.
      NOTE:

      To change the connection ports of source servers in batches, use the Change Port button above the list.

    Credential

    Select the server credential added to the MgC Agent. If batch credential association is performed, the system automatically fills in the credential, and you do not need to select it.

  4. Click Confirm. The system checks whether the source server can be accessed using the information you provide and whether the server can be migrated. If Completed shows up in the Migration Readiness Check column, the source server can be migrated.

    If the check fails, move the cursor to Check failed in the Migration Readiness Check column to view the failure cause. After rectifying the fault, click Check Again.

  5. After all the source servers pass the readiness check, click Next to configure target servers.

Step 6: Configure Target Servers

There are two methods for configuring target servers.

If you have servers on Huawei Cloud, you can associate them with source servers for receiving migrated data.

  1. On the Configure Target page, select Associate existing target servers for Configuration Method.
  2. In the Target Region drop-down list, select the region where the existing target servers are located. For Project, the default IAM project in the selected region is used.
  3. Locate a source server and click Associate Target in the Operation column.
  4. Select the desired target server and click Confirm.

You can define target server specifications and allow the system to purchase target servers as part of the migration process.

  1. On the Configure Target page, select Purchase new target servers for Configuration Method.
  2. Configure target servers using any of the following methods:

    • Method 1: Generating target recommendations. The system can provide recommendations for Huawei Cloud server sizes tailored based on the specifications of the source servers. If the recommended configurations do not align with your requirements, you can make changes as necessary. In the migration process, the system will automatically purchase target servers based on your settings.
      1. In the source server list, select the ones for which you want to generate target recommendations. Then click Generate Target Recommendations above the list.
      2. Configure an assessment policy based on Table 4.
        Table 4 Settings used for computing target recommendations

        Parameter

        Description

        Priority

        • High performance

          MgC recommends target resources designed for optimal performance.

        • Low cost

          MgC recommends the most cost-effective target resources that meet your demands.

        Preferences

        Configure your preferences for target servers. The system will prioritize your preferences and try to match them first during the recommendation process. For details about how the system recommends appropriate target resources, see How Does MgC Generate Target Recommendations?

        • Server Types (Optional)

          Select the server types you prefer.

        • Server Series (Optional)

          Select the server series you prefer. The system will generate recommendations based on your preferred server types and series.

          NOTICE:

          If you select Display only series allowed on DeHs, Server Types will be dimmed, and the server series allowed on DeHs in the target region will be listed.

        • System Disk (Optional)

          Select the system disk type you prefer.

        • Data Disk (Optional)

          Select the data disk type you prefer.

        • Sizing Criteria

          Choose the criteria that the system will use to generate server recommendations.

          • If you select As-in on source, the system will recommend target servers with the same or similar CPU and memory capacity as the source servers.
          • If you select Performance-based, you need to perform a performance collection for the source servers, and then set assessment parameters. The system will then recommend target servers with your desired CPU and memory capacity.
            NOTICE:

            The more performance data is collected, the more accurate the recommendations are. The collection of server performance data should take no less than seven days.

      3. Click Confirm. If Configured shows up in the Target Configuration column, the target recommendations are generated. You can check the recommended configurations in the next two columns.
    • Method 2: Defining target server specifications. You can manually configure target server specifications. Before proceeding with this method, carefully assess any associated risks. It is also essential to ensure that the chosen specifications meet your system requirements and compatibility standards.
      1. In the source server list, select the servers for which you want to manually configure target servers. Then click Configure Target above the list. Alternatively, click Configure Target in the Operation column.
      2. In the Target Specifications area, select the target server specifications as required.
      3. In the Target Disks area, select a storage type and size for each target server disk.
      4. Click Confirm. Manual will appear in the Target Configuration column.
    • Method 3: Importing target server configurations. You can export the server records, configure target server flavors, disks, and images, and then import the records back. Some technical expertise is needed for this process.
      1. In the list of source servers, choose Export/Import Target Configuration > Export Target Configuration to download the server records as an Excel file to the local PC.
      2. Open the exported file. On the first sheet named servers, the blue columns (A to G) indicate the source server information, which does not need to be modified. The yellow columns (H to K) indicate the target server information, which needs to be configured.
      3. Configure the target server information (in columns H to K) according to Table 5.
        Table 5 Parameters in columns H to K

        Parameter

        Configuration

        flavor

        Specify a flavor for each target server. The second sheet flavors lists the flavors in S (general-purpose) and C (computing-plus) server series available in the target region. Choose a proper flavor and copy the flavor name to this cell.

        NOTE:

        If a source server has been assessed, the recommended flavor is included in the exported file. If a source server has not been assessed, its flavor field is empty.

        disks(name,osDisk,type,capacity;)

        Enter the information about all disks. Separate multiple disks with semicolons (;). You must specify the name, function (system disk or not), type, and size for each disk. Separate these items with commas (,). Specify a disk size as a numeric value without a unit. The default unit is GiB.

        Example: /dev/sda,true,SAS,1024;/dev/sdb,false,SAS,2046

        NOTE:

        If a source server has been assessed, the recommended disk specifications show up in the exported file. If a source server has not been assessed, the source disk specifications remain in this column, but the disk type changes to SAS by default.

        image_type

        Enter an image type. The options are:

        • public: public image
        • private: private image
        • shared: shared image

        image

        Enter an image name. You can view all images available in the target region on the third sheet images.

      4. After configuring a target server for each source server, save the Excel file. Return to the MgC console. Choose Export/Import Target Configuration > Import Target Configuration above the list of source servers.
      5. In the displayed dialog box, click Access OBS.

      6. Select a bucket and upload the Excel file to the bucket.
      7. After the upload is successful, return to the MgC console. In the Import Target Configuration dialog box, select the file stored in the OBS bucket from the drop-down list.
      8. Click Confirm to import the target server configurations.
        • If the flavor field is empty in a row, this row will be ignored during the import.
        • If the disk or image field is left empty in a row, the source server's disk and image information is used during the import.
        • If the number in the disk field in a row is inconsistent with what the source server actually has, an error message is reported, indicating that the disk numbers are inconsistent.
        • If in a row, the disk type conflicts with the flavor, an error message will be reported, indicating that the disk type is incorrect.

  3. (Optional) Configure an image to define the OS for target servers. Before proceeding with this method, carefully assess any associated risks. It is also essential to ensure that the chosen image meets your system requirements and compatibility standards.

    1. In the server list, select the source servers and click Configure Image above the list.
    2. On the displayed page, choose an image type, an OS, and an OS version and click Confirm. If a target server has a system disk smaller than what defined in the image you choose, configuring the image will fail for that server.

  4. (Optional) Configure a DeH to receive applications and data migrated from source servers. Then after you create a migration workflow using this plan, the system will provision target servers on that DeH.

    1. In the upper right corner of the source server list, enable Use DeH.
    2. Select the source servers and choose DeH Configuration > Associate DeH above the list.
    3. Select the target DeH to be associated from the drop-down list and click Confirm. Associated will show up in the DeH column. You can click Details to view the associated DeH.

  5. Configure a target environment based on Table 6.

    Table 6 Parameters for configuring a target environment

    Parameter

    Configuration

    VPC

    Select a VPC for the target servers from the drop-down list. For details about how to create a VPC, see Creating a VPC.

    • If the source IP address is 192.168.X.X, you are advised to create a VPC and a subnet that both belong to network range 192.168.0.0/16.
    • If the source IP address is 172.16.X.X, you are advised to create a VPC and a subnet that both belong to network range 172.16.0.0/12.
    • If the source IP address is 10.X.X.X, you are advised to create a VPC and a subnet that both belong to network range 10.0.0.0/8.

    Subnet

    The subnet has to be in the same network segment as the VPC.

    Security Group

    The selected security group must:

    • Allow inbound ports 8899, 8900, and 22 required for Windows migrations.
    • Allow inbound port 22 required for Linux file-level migrations.
      CAUTION:
      • For security purposes, you are advised to only allow traffic from the source servers on these ports.
      • These ports must also be opened on the firewalls of target servers.

      For details about how to create a security group, see Creating a Security Group.

    Disk Encryption

    If this option is not selected, the system and data disks of target servers created in the migration workflow will remain unencrypted.

    If this option is selected, the system and data disks of target servers created in the migration workflow will be encrypted.

    NOTICE:
    • This setting applies to all target servers newly created in the workflow. Their disks will be encrypted using the same key.
    • The encryption attribute of a disk cannot be modified after the disk is created.
    • Keys can be shared with accounts, not IAM users.

    To enable disk encryption, you need to create an agency to authorize EVS to access KMS. If you have the right to grant the permissions, grant the KMS access permissions to EVS directly. After the authorization succeeds, you do not need to perform the authorization again. If you do not have the right to grant the permissions, contact a user with the Security Administrator permissions to grant you the right and then repeat the preceding operations. After the authorization is successful, configure the following parameters:

    • Select an existing key
      NOTICE:

      Only enabled keys generated using the AES_256 encryption algorithm are supported.

      Select a key from the drop-down list. You can select one of the following keys:

      Default keys: After the KMS access permissions have been granted to EVS, the system automatically creates a default key and names it evs/default.

      Custom keys: You can choose an existing key or create a new one. For details about how to create a key, see Creating a Key.

    • Enter a key ID

      Enter the ID of a key shared from another user. Ensure that the key is in the target region. For details, see Creating a Grant.

    Enterprise Project

    Select the enterprise project you want to migrate to. The enterprise project default is selected by default. For details about enterprise projects, see What Is Enterprise Project Management Service?

    Tags

    You can add tags to the target servers created automatically by the workflow to facilitate resource management.

    Click Add Tag and enter a tag key and tag value. For details about tags and tag naming rules, see Tag Overview.

    To add the same tag to multiple servers or other resources, you can create a predefined tag on the TMS console and then select the tag for the servers or resources. This frees you from repeatedly entering tag keys and values. For details, see Creating Predefined Tags.

  6. Configure the ports required for the migration based Table 7.

    Table 7 Parameters about migration ports

    Parameter

    Configuration

    Migration Port

    It defaults to 22. If port 22 is occupied, you can use one from 10000 to 65535.

    CAUTION:

    The following ports cannot be used as the migration port:

    135, 139, 445, 5357, 5985, 5986, 8899, 8900, 47001, 49664, 49665, 49666, 49668, 49669, 49671, 49674, 49677, 49679, 49680, 49681, 49682, 49683, 49685, 49690, 49691, 49693, 49694, 49695, 49698, 49699, 49700, 49702, 49703, 49704, 49705, 49706, 49707, 49708, 49709, 49710, 49711, 49712, and 49713

    Ensure the specified port is not in the blacklist above or occupied by another service on source servers, and verify that network settings permit traffic through this port.

    The functions of the port are as follows:

    • For Linux servers, this port is used to establish transmission channels and transmit data.
    • For Windows servers, this port is used to establish transmission channels.

    Control Port

    This port is used to transmit task control signals for Windows servers. It defaults to 8899 and cannot be changed.

    Transmission Port

    This port is used to transmit data for Windows servers. It defaults to 8900 and cannot be changed.

  7. Click Next to open the Configure Migration Settings page.

Step 7: Configure Migration Settings

  1. Configure migration settings based on Table 8.

    Table 8 Migration settings

    Area

    Parameter

    Description

    Migration Network

    Public

    If you select Public, ensure that all target servers have EIPs bound. These EIPs will be used for the migration.

    Private

    If you select Private, configure Direct Connect connections, VPN connections, VPC peering connections, or subnets in the target VPC in advance to connect the source environment to the target environment.

    • If the source environment cannot access the Internet, enter the private IP address of the source proxy server and the port used by the proxy software.
    • If the source proxy server cannot access the Internet, put the SMS-Agent installation package at a location where the source servers can access directly or over a proxy. You can download the SMS-Agent installation package from the SMS console.

    Source Settings

    Install rsync on Source

    Linux migrations depend on rsync. If rsync is not installed on a source server, the server will fail to be migrated.

    • If this option is not selected, rsync will not be installed on the source servers.
    • If this option is selected, rsync will be automatically installed on the source servers. The installation can succeed only if the source servers:
      • Have the Internet access. If a proxy server is required, ensure that the proxy settings are correctly set in /etc/yum.conf (for CentOS and Red Hat) or /etc/apt/apt.conf (for Ubuntu).
      • Have outbound ports 80 (HTTP) and 443 (HTTPS) enabled by the firewalls and security groups.
      • Have accessible software sources. You are advised to configure a source based on your location. Cross-country access to the official source may experience high latency and packet loss, which may result in download failures.
      • Have sufficient CPU, memory, and I/O resources to prevent latencies or interruptions during installation.
      NOTE:

      If the automatic installation fails, manual installation is required. For details, see rsync Not Installed on the Source Server.

    Target Settings

    Start Target After Migration

    • If this option is not selected, the target servers will be stopped after the migration is complete.
    • If this option is selected, the target servers will be started after the migration is complete.

    Retain IP Address

    If this option is selected, the private IP addresses of the source servers will be retained on the target servers after the migration is complete. Enabling it may cause risks. You need to evaluate and take responsibility for any potential risks. For details, see How Do I Keep the Private IP Address of a Server Unchanged After the Migration?

    Consistency Verification

    Verify Data Consistency

    • If this option is not selected, data consistency will not be verified after the full replication is complete. You can modify the verification policy after the incremental synchronization is complete.
    • If this option is selected, the system will automatically verify data consistency after the full replication is complete. This is a quick verification, and only the file size and last modification time will be verified. You can modify the verification policy after the incremental synchronization is complete.

    Advanced Settings

    Set Bandwidth Limit

    • If this option is not selected, the migration traffic is not limited.
    • If this option is selected, you can limit the bandwidth that can be used for migration based on the source bandwidth and service requirements.
    CAUTION:

    Consider the migration scale to set an appropriate bandwidth limit. If too small a bandwidth is allocated to a workflow that includes 10 servers, migration tasks in the workflow may preempt the limited bandwidth resource, and some servers may fail to be migrated.

    Enable Quick Mode

    Enable this option if incremental synchronization is not required. This option is disabled by default. If it is enabled, incremental synchronization is skipped and then subsequent steps are performed after full replication is complete in the workflow. Set this option based on your requirements.

    Send SMN Notifications

    Determine whether to get SMN notifications about the migration workflow. You can configure Topic, Language, and Trigger Condition.

    Before enabling this function, create an SMN topic and subscribe to it. For details, see Publishing a Template Message.

    NOTE:

    You can only choose an SMN topic in the default IAM project of the region where you currently use MgC.

    To enable this function, you need to authorize MgC when the system prompts you.

    Select one or more trigger conditions.

    • Migration succeeded: A notification will be sent if all resources in the migration workflow are migrated.
    • Migration failed: A notification will be sent if any resource in the migration workflow fails to be migrated.
    • Manual checkpoint: A notification will be sent if all resources in the migration workflow are waiting for manual confirmation.

  2. Click Next to open the Confirm page.

Step 8: Create a Batch Server Migration Workflow

  1. On the Confirm page, check the resource and migration settings carefully to ensure that they meet your requirements. To update the settings, click Previous to return to the corresponding stage for modification.
  2. After confirming the settings are correct, click Create Workflow in the lower right corner of the page. The Start Workflow dialog box is displayed, indicating that the workflow has been created.

    • If you want to start the migration immediately, click OK to start the workflow and view the workflow details.
    • If you want to save the migration workflow without starting the migration, click Cancel. The migration workflow will move to a Waiting status, and the migration has not started yet. To run the workflow, click Run in the Operation column to manually start the migration.

    For more information about migration workflows, see Creating a Batch Server Migration Workflow.