All Products
Search
Document Center

Simple Application Server:Migrate data from a simple application server to an ECS instance by using a shared image

Last Updated:Apr 09, 2025

If your current 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 to obtain more flexible resource configuration solutions. This topic describes how to migrate data from a simple application server to an ECS instance in the same region or across regions.

Prerequisites

Scenarios

The scenarios of migrating data from a simple application server to an ECS instance include:

  • Scenario 1: Migrate data from a simple application server to an ECS instance in the same region

    The following figure shows the migration process: asdasd Description:

    1. Create a snapshot for the simple application server whose data you want to migrate.

    2. Create a custom image based on the snapshot.

    3. Share the custom image with an ECS instance in the same region.

    4. In the ECS console, create an ECS instance based on the shared image. This way, data is migrated from the simple application server to the ECS instance in the same region.

  • Scenario 2: Migrate data from a simple application server to an ECS instance across regions

    The following figure shows the migration process: adas Description:

    1. Create a snapshot for the simple application server whose data you want to migrate.

    2. Create Custom Image A based on the snapshot.

    3. Copy Custom Image A to the destination region to generate Custom Image B.

    4. Share Custom Image B with ECS. Finally, create an ECS instance based on the shared custom image.

Impacts of the migration

Item

Description

Authorized applications on the ECS instance and the simple application server

The ECS instance and the simple application server reside in different virtual private clouds (VPCs). After data is migrated from the ECS instance to the server, the underlying hardware may change, and hardware-locked application licenses may become invalid. You are responsible for maintaining the application licenses valid.

Public IP address

The public IP address of the ECS instance is different from that of the server. If a domain name is associated with the server, you must resolve the domain name to the public IP address of the ECS instance after you migrate data from the server to the ECS instance.

Sample configurations of the simple application server and the ECS instance

Note

This topic provides only sample configurations. In practice, you must configure resources based on your business requirements. For example, if the firewall of your simple application server allows traffic over ports 80, 443, 22, 8080, and 3306, the security group to which your ECS instance belongs must also allow inbound traffic over ports 80, 443, 22, 8080, and 3306.

Configuration of the simple application server

Configuration of the ECS instance

  • Region: China (Hangzhou).

  • Image: application image LNMP 7.4.

  • Firewall: allows traffic over ports 80, 443, 22, 8080, and 3306.

  • Sample configurations of the server: The test web page file test.html is stored in the default folder named default in the website root directory /data/wwwroot. The content of the test file is Test-Ecs-001.

  • Region:

    • Migrate data in the same region: China (Hangzhou).

    • Migrate data across regions: China (Beijing).

  • Instance type: We recommend that you use compute-optimized instance types such as ecs.c6.large to deploy the web application.

  • Image: a custom image of the simple application server that is shared with ECS.

  • Network: The ECS instance belongs to a virtual private cloud (VPC) and is assigned a public IP address.

  • Security group: allows inbound traffic over ports 80, 443, 22, 8080, and 3306.

Procedure

You can migrate data from a simple application server to an ECS instance in the same region or across regions based on your migration scenarios.

Scenario 1: Migrate data from a simple application server to an ECS instance in the same region

  1. Log on to the Simple Application Server console.

  2. Create a snapshot for the server. For more information, see Create a snapshot.

    If your simple application server has a data disk attached and you want to migrate the data both on the system disk and the data disk to the ECS instance, you must separately create snapshots for the system disk and the data disk.

  3. Create a custom image based on the snapshot. For more information, see Create custom images.

    Parameter description:

    • Name: the name of the custom image that you manually set to identify the image. Example: LNMP-to-Ecs.

    • Description: the description of the custom image that you manually set to record information about the image. Example: Test sharing an image with ECS.

    • Data Disk Snapshot: If your simple application server has a data disk attached and you want to migrate the data on both the system disk and data disk of the simple application server to the ECS instance, select the data disk snapshot. If your simple application server does not have a data disk attached or you do not want to migrate the data on the data disk, do not select the data disk snapshot.

  4. Share the custom image with ECS.

    Perform the following operations. For more information about how to share custom images, see Share an image to ECS.

    1. On the Image page, find custom image LNMP-to-Ecs and click Share to ECS in the Actions column.

    2. In the message that appears, click Confirm.

      After the image is shared, Share to ECS is automatically changed to Unshare the image to ECS in the Actions column of custom image LNMP-to-Ecs on the Image page.

  5. Create an ECS instance based on the shared image.

    1. On the Image page, find custom image LNMP-to-Ecs and click Create ECS in the Actions column.

      You are redirected to the ECS instance buy page.

    2. On the Custom Launch tab of the ECS instance buy page, configure parameters to create an instance based on the shared image.

      In this example, the following configurations are used:

      • Region and Zone: Use the default region. By default, the region where the LNMP-to-Ecs custom image resides is used. The zone is randomly selected.

      • Instance Type: In this example, the ecs.c6.large instance type of the Compute-optimized category is used.

      • Image: Use the default settings. The value is the ID of the shared image generated after the LNMP-to-Ecs custom image is shared with ECS.

      • Public IP Address: Select Assign Public IPv4 Address.

      • Security Group: Select an existing security group or create a security group. Make sure that the ports required by the ECS instance are enabled in the inbound rules of the security group. In this example, you must select a security group that allows traffic on ports 22, 80, 443, 3306, and 8080.

      • Instance Name: Specify a name for the ECS instance. In this example, the name is test-Ecs-LNMP

      You can configure other parameters based on your business requirements. For more information about how to create an ECS instance, see Create an instance on the Custom Launch tab.

      After you create the ECS instance, go to the ECS console. In the left-side navigation pane, choose Instances & Images > Instances. On the Instances page, you can find the test-Ecs-LNMP instance that you created.

  6. Test the access to the website on the ECS instance.

    1. On the Instances page, view the information of the test-Ecs-LNMP instance.

    2. In the IP Address column, obtain the public IP address of the ECS instance.

      You must make sure that the instance is in the Running state. Otherwise, you will not be able to test access to the website deployed on the ECS instance. 公网IP地址

    3. On your on-premises machine, use a browser to access http://<Public IP address of the ECS instance>/test.html.

      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实例测试网站 This indicates that the data on the simple application server is migrated to the ECS instance.

Scenario 2: Migrate data from a simple application server to an ECS instance across regions

  1. Log on to the Simple Application Server console.

  2. Create a snapshot for the server. For more information, see Create a snapshot.

    If your simple application server has a data disk attached and you want to migrate the data both on the system disk and the data disk to the ECS instance, you must separately create snapshots for the system disk and the data disk.

  3. Create a custom image based on the snapshot. For more information, see Create custom images.

    Parameter description:

    • Name: the name of the custom image that you manually set to identify the image. Example: LNMP-to-Ecs.

    • Description: the description of the custom image that you manually set to record information about the image. Example: Test sharing an image with ECS.

    • Data Disk Snapshot: If your simple application server has a data disk attached and you want to migrate the data on both the system disk and data disk of the simple application server to the ECS instance, select the data disk snapshot. If your simple application server does not have a data disk attached or you do not want to migrate the data on the data disk, do not select the data disk snapshot.

  4. Copy the custom image to the destination region.

    Perform the following operations. For more information about how to copy a custom image, see Copy a custom image.

    1. On the Image page, find custom image LNMP-shared-Ecs 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.

      The following table describes the parameters.

      Parameter

      Description

      Destination Region

      Select a destination region to which you want to copy the custom image. Example: China (Beijing).

      Name of the custom image

      Enter a name for the copy of the custom image for identification. Example: test-copy-image.

      Description

      Enter a description for the copy of the custom image. The default description contains the ID and source region of the custom image. You can modify the description.

      After you confirm the copy operation, you can view that the custom image in the destination region is in the Copying state on the Image page. You must wait for the custom image to be copied.

      Note

      After the custom image is copied, the Server ID/Name column of the custom image in the destination region is empty.

  5. Share the custom image with ECS.

    Perform the following operations. For more information about sharing custom images, see Share an image to ECS.

    1. On the Image page, find custom image test-copy-image and click Share to ECS in the Actions column.

    2. In the message that appears, click Confirm.

      After the custom image is shared, Share to ECS is automatically changed to Unshare the image to ECS in the Actions column of custom image test-copy-image on the Image page.

  6. Create an ECS instance based on the shared image.

    1. Click Create ECS Instance in the Actions column of custom image test-copy-image.

      You are redirected to the ECS instance buy page.

    2. On the Custom Launch tab of the ECS instance buy page, configure parameters to create an instance based on the shared image.

      In this example, the following configurations are used:

      Parameter

      Description

      Region and Zone

      Use the default settings. In this example, the default region is China (Beijing), and the default zone is randomly selected.

      Instance Type

      In this example, ecs.c6.large of the Compute-optimized instance family is used.

      Image

      Use the default settings. The test-copy-image custom image is automatically filled out.

      Public IP Address

      Select Assign Public IPv4 Address.

      Security Group

      Select an existing security group or create a security group. Make sure that the ports required by the ECS instance are enabled in the inbound rules of the security group. In this example, you must select a security group that allows traffic on ports 22, 80, 443, 3306, and 8080.

      Instance Name

      Specify a name for the ECS instance. Example: test-Ecs-LNMP.

      You can configure other parameters based on your business requirements. For more information about how to create an ECS instance, see Create an instance on the Custom Launch tab.

      After you create the ECS instance, go to the ECS console. In the left-side navigation pane, choose Instances & Images > Instances. On the Instances page, you can find the test-Ecs-LNMP instance that you created.

  7. Test the access to the website on the ECS instance.

    1. On the Instances page, view the information of the test-Ecs-LNMP instance.

    2. In the IP Address column, obtain the public IP address of the ECS instance.

      You must make sure that the instance is in the Running state. Otherwise, you will not be able to test access to the website deployed on the ECS instance. 公网IP地址

    3. On your on-premises machine, use a browser to access http://<Public IP address of the ECS instance>/test.html.

      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实例测试网站 This indicates that the data on the simple application server is migrated to the ECS instance.

What to do next

After the data is migrated, the public IP address that you can use to access the data changes. If you configured a domain name for the source simple application server, you must also configure a domain name for the destination ECS instance after the migration. For more information, see Add DNS records.