All Products
Search
Document Center

Simple Application Server:Migrate data from a simple application server to an ECS instance

Last Updated:Mar 04, 2024

If your simple application server cannot meet your business requirements, you can smoothly migrate data from the simple application server to an Elastic Compute Service (ECS) instance for flexible resource configuration. The source simple application server and the destination ECS instance must belong to the same Alibaba Cloud account but can reside in different regions. This topic describes how to migrate data from a simple application server to an ECS instance.

Migration impacts

Item

Description

Authorized applications on the ECS instance and the simple application server

The virtual private cloud (VPC) of the simple application server and the VPC of the ECS instance cannot communicate with each other. Therefore, after you migrate data from the simple application server to the ECS instance, the VPC of the migrated data changes. The underlying hardware of the ECS instance is different from that of the simple application server. After you migrate data from the simple application server to the ECS instance, the application licenses that are bound to the underlying hardware become invalid. You must maintain the application licenses valid.

Public IP address

After you migrate data from the simple application server to the ECS instance, the IP address that points to the migrated data changes because the simple application server and the ECS instance use different public IP addresses. If the simple application server has a domain name, you must resolve the domain name to the public IP address of the ECS instance after the migration.

Procedure

Scenarios

Method 1: Migrate data by using a shared image

Important

You have an existing ECS instance and a simple application server that has a data disk attached. You want to migrate data contained in the data disk from the simple application server to the ECS instance. In this scenario, you can migrate data by using Server Migration Center (SMC).

  1. Log on to the Simple Application Server console.

  2. Create a snapshot.

    In the left-side navigation pane, click Disk. On the Disks page, find the system disk or data disk from which you want to create a snapshot and click Create Snapshot in the Actions column.

    Important
    • If you want to migrate data contained in the system disk and data disk of the simple application server at the same time to an ECS instance, you must create snapshots from both the system disk and data disk. For more information, see Create a snapshot.

    • If your Alibaba Cloud account has no more than five simple application servers, the maximum number of free snapshots that you can create is triple the number of simple application servers. If your Alibaba Cloud account has more than five simple application servers, the maximum number of free snapshots that you can create is 15. You can delete snapshots that are not in use to prevent snapshot fees. You are charged for snapshots beyond the free quota. For more information about the billing rules of snapshots, see Snapshots.

  3. Create a custom image from a system disk snapshot.

    In the left-side navigation pane, click Snapshots. Find the system disk snapshot that you created and click Create Custom Image in the Actions column. Follow the on-screen instructions to complete the creation.

    Important

    Usage note of the Data Disk Snapshot parameter: If the simple application server has a data disk and you want to migrate data contained in the data disk to an ECS instance, select the data disk snapshot that you created from the drop-down list. In other cases, you can leave the Data Disk Snapshot parameter empty. For more information, see Create a custom image.

  4. (Conditionally required) Copy the custom image to another region. If the migration is in the same region, skip this step.

    The region of the custom image is consistent with that of the simple application server. Therefore, you do not need to copy the custom image anywhere. If the simple application server and the ECS instance to which you want to migrate data reside in different regions, you must copy the custom image to the region of the ECS instance.

    1. In the left-side navigation pane, click Image. On the Image page, find the custom image that you created and click Copy Image in the Actions column.

    2. In the Copy Image dialog box, configure parameters based on your business requirements and click Confirm.

      Set the value of the Destination Region parameter to the region of the ECS instance to which you want to migrate data. Example: China (Beijing).

    3. In the upper-left corner of the Simple Application Server console, select the region to which the image is copied, such as China (Beijing)., to view the status of the image copy.

      It takes about one to two minutes to copy an image from a region to another region. Wait until the image is copied.

      Note

      The Server ID/Name column of the custom image in the destination region is empty. When the Created At column of the custom image displays a specific point in time, the custom image is copied.

  5. Complete the migration.

    • New ECS instance: You can migrate data contained in the system disk and data disk of a simple application server at the same time to a new ECS instance.

    • Existing ECS instance: You can migrate only data contained in the system disk of a simple application server to an existing ECS instance.

      Purchase an ECS instance to migrate data

      1. In the left-side navigation pane, click Image. On the Image page, find the custom image that you created.

      2. Click Create ECS Instance in the Actions column. Follow the on-screen instructions to complete the purchase.

        When you create an ECS instance on the ECS buy page, take note of the following items:

        • Region and Zone: Retain the default settings.

        • Image: Retain the default setting.

        • Public IP Address: Select Assign Public IP Address.

        • Security Group: Select a security group whose inbound rules allow traffic over the required ports. We recommend that you use the same firewall configuration for the ECS instance and the simple application server.

        Configure other parameters based on your business requirements. For more information, see Create an instance on the Custom Launch tab.

        After you create an ECS instance, log on to the ECS console. Choose Instances & Images > Instances. Then, view the ECS instance that is created on the Instance page. If the ECS instance is created, the migration is complete.

      Use an existing ECS instance to migrate data

      If you want to migrate data from the simple application server to an existing ECS instance, you can replace the OS of the existing ECS instance. You can migrate only data contained in the system disk of a simple application server to an existing ECS instance.

      1. In the left-side navigation pane, click Image, find the desired custom image, and click Share to ECS in the Actions column.

      2. Log on to the ECS console and choose Instances & Images > Instances.

      3. Find the desired ECS instance and click Stop in the Actions column. In the Stop Instance dialog box, select Stop in the Stopped By field and click OK.

      4. After the status of the ECS instance changes to Stopped, click Replace Operating System in the Actions column. In the Replace Operating System dialog box, select Replace System Disk in the Replacement Method field, read the precautions, and select I understand the risks. Then, click Continue to Replace Operating System.

        On the Change Operating System page, configure the following parameters. For more information about the parameters, see Replace the operating system (system disk) of an instance.

        • Image: Click Shared Image and select the desired custom image.

        • System Disk: Specify a disk size that is greater than the current disk size. You cannot change the system disk category.

        If a message that indicates the OS is changed appears, the migration is complete.

  6. Access the website deployed on the ECS instance to check the status of the ECS instance.

    Obtain the public IP address of the ECS instance and visit http://Public IP address of the ECS instance/test.html by using the browser on your on-premises host.

    公网IP地址

    When you access the public IP address of the ECS instance, the following page is displayed: The test website deployed on the test-Ecs-LNMP instance can be accessed, and the website content is consistent with the content of the test website deployed on the source simple application server.

    Note

    This topic provides the migration results in the sample scenario. In actual practice, you can log on to the ECS instance after data is migrated and check whether the data on the ECS instance is consistent with the data on the source simple application server.

    ECS实例测试网站The migration is complete.

Method 2: Migrate data by using SMC

  1. Make sure the following requirements are met:

    • The simple application server whose data you want to migrate is in the Running state. If the simple application server is expired, you must renew the server first. For more information, see Upgrade and renew a simple application server.

    • Migration preparations are complete. For more information, see Before you begin.

  2. Import the information of the migration source.

    In this example, the information of a Linux migration source is imported by using the CLI. For information about how to import the information of a Windows migration source by using the CLI, see Import the information about a Windows server.

    1. Log on to the SMC console.

    2. In the left-side navigation pane, click Migration Sources. On the Migration Sources page, click Import Migration Source.

      Configure parameters as prompted to generate and copy an activation code.

      Parameter

      Description

      Migration Source Type

      The type of the migration source. Select Physical Server/VM/Cloud Server.

      Import Method

      The method that you want to use to import the information of the migration source. Select Use CLI to Import Server.

      Note

      SMC provides multiple methods to import information of migration sources, including using the SMC console, the CLI, and the SMC client. For more information, see Import the information about a migration source by using the SMC console.

      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

      Click Generate, click the Linux Shell tab, and then click Copy to copy the command.

      Note

      You can also click the user_config.json tab to copy the values of the access_token_id and access_token_code parameters. If you import the information about a migration source by using the SMC client, run the ./go2aliyun_client --accesstokenid=xxx --accesstokencode=xxx command. Replace xxx with actual values.

    3. Log on to the simple application server by using a password from Workbench as the root user. Paste and run the copied command to complete the import.

      image.png

      The following sample command output indicates that the import is successful:

      [2022-08-11 14:40:45] [Info]  Snapshot Check...
      [2022-08-11 14:40:49] [Info]  Verify User Account...
      [2022-08-11 14:40:49] [Info]  Generate SSH Key...
      [2022-08-11 14:40:49] [Info]  Import Source Server...
      [2022-08-11 14:40:49] [Info]  Import Source Server [s-bp18x8751kgz2oyh****] Successfully!
      [2022-08-11 14:40:50] [Info]  =========   Run In BackGround Daemon Mode   =========
      [2022-08-11 14:40:50] [Info]  Goto Aliyun Begin...
      [2022-08-11 14:40:50] [Info]  Check Source Server Status...
      [2022-08-11 14:40:50] [Info]  Check Replication Job Status...
      Please Goto SMC Console To Create New Job, time: 1m0s    -
      Note

      If the information of the migration source fails to be imported or an error occurs during the migration, you can check the log files in the directory of the SMC client for more information. By default, the SMC client is installed in the /smc directory on a Linux server.

  3. Create and start a migration job.

    1. Go back to the SMC console. Find the desired migration source and click Create Migration Job in the Actions column.

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

      The following table describes the key parameters. You can retain the default values for other parameters. For more information about the parameters, see Create a server migration job.

      Parameter

      Description

      Migration Job Type

      The type of the migration job. After you select Server Migration, carefully read the migration instructions.

      Migration Job Name

      The name of the migration job.

      Note

      The job name must be unique within the selected Alibaba Cloud region.

      Job Description

      The description of the migration job.

      Destination Region

      The destination region is the region in which the ECS instance resides. This parameter is required. For more information about regions, see Regions and Zones.

      Destination Type

      You can select ECS Image or ECS Instance based on your business requirements.

      • ECS Image: If you do not have an ECS instance, you must select this destination type to create a new ECS instance.

      • ECS Instance: If you have an existing ECS instance, you can select this destination type to migrate data of a simple application server.

      ECS Image

      You can migrate the source server to an Elastic Compute Service (ECS) image and then create an ECS instance by using the image.

      If you set the Destination Type parameter to ECS Image, the following parameters are displayed:

      • Destination Region: the Alibaba Cloud region to which you want to migrate the source server. This parameter is required. For more information about regions, see Regions and Zones.

      • Image Name: the name of the destination ECS image generated by SMC for the migration source.

      ECS Instance

      You can migrate the source server to an ECS instance that you have purchased. The storage system and operating system of the source server must be compatible with those of the destination ECS instance. For more information about best practices, see Migrate servers to ECS instances.

      Important
      • After a migration job is created, all original data is deleted from the destination ECS instance. If the source server is migrated to a simple application server, the original data in the destination simple application server is not deleted. If the destination ECS instance contains important data, we recommend that you do not directly migrate the source server to the destination instance. In this case, we recommend that you set the Destination Type parameter to ECS Image to migrate the source server to an ECS image and then create an ECS instance by using the image. For more information about how to migrate a source server to an ECS instance, see Migrate servers to ECS instances.

      • During the migration, a pay-as-you-go cloud disk is created for temporary use. The cloud disk serves as a data transfer hub and is automatically released after the migration is complete.

      • During the migration, the operating system of the destination ECS instance is changed, and the automatic snapshots of the system disk are deleted and cannot be recovered. You can manually disable the Delete Automatic Snapshots While Releasing Disk feature to retain the snapshots. For more information, see Delete automatic snapshots while releasing a disk.

      If you set the Destination Type parameter to ECS Image, the following parameters are displayed:

      • Destination Region: the Alibaba Cloud region to which you want to migrate the source server. This parameter is required. For more information about regions, see Regions and Zones.

      • Destination Instance: the ECS instance that is used as the destination instance.

      Important

      During the migration, do not stop, start, restart, or release the destination ECS instance. Otherwise, the migration fails.

    3. In the message that appears, read the migration notes and click Got It.

      Wait until the migration job is complete. When the status of the migration job changes from Preparing to Completed, the data is migrated from the simple application server to the ECS instance.

      image.png

  4. (Conditionally required) If you set Destination Type to ECS Image when you create a migration job, click Create Instance in the Actions column to create an ECS instance. For more information, see Create an ECS instance by using a custom image.

    If an error message appears during the migration, see FAQ and Errors occurred during a server migration.

What to do next