If you cannot upgrade the configurations of your simple application server to meet the business requirements, you can migrate the website data in the simple application server to another simple application server in the same region or another. This topic describes how to migrate data between simple application servers in the same region or across regions.

Prerequisites

  • The source simple application server is in the Running state. If the server is expired, renew the server first. For more information, see Renew a server.
  • The source simple application server uses the same image as that of the destination simple application server. If the two servers use different images, reset one of the servers. For more information, see Reset a simple application server.

Scenarios

In the following examples, Mantis Bug Tracker (MantisBT) deployed on the source server is migrated to the destination sever. At the same time, all the data is migrated, and the system runs normally. The following table describes the detailed scenarios.
Note If you can upgrade the configurations of your simple application server to meet your business requirements, we recommend that you upgrade the configurations. For more information, see Upgrade the configurations of a simple application server.
Scenario Configuration of the source server Configuration of the destination server
Migrate data between servers in the same region
  • Server name: Simple Application Server A (Server A)
  • Region: China (Hong Kong)
  • Image: LAMP 7.4 application image
  • Firewall: Inbound traffic is allowed over Ports 80, 443, and 22.
  • Application: MantisBT is deployed in the website root directory /data/wwwroot/default of Sever A.
Note For information about how to deploy MantisBT, see Deploy MantisBT.
  • Server name: Simple Application Server B (Server B)
  • Region:
    • Data migration in the same region: China (Hong Kong)
    • Data migration across regions: Singapore
  • Image: LAMP 7.4 application image
  • Firewall: Inbound traffic is allowed over Ports 80, 443, and 22.
Migrate data between servers across regions

Preparations and precautions

Before you migrate data, make the following preparations:
  • Create a snapshot to back up data.

    We recommend that you create a snapshot for Server A before you migrate the data on Server A. If a data exception occurs due to migration failure, you can use the snapshot to roll back the disk to restore data of Server A. For more information, see Create a snapshot.

  • Check the network.

    Make sure that Server A and Sever B can be accessed over the Internet. If Server A and Server B are deployed in different countries, you may experience low migration due to high network latency.

  • Check the application licenses on the source server.

    Simple application servers that are deployed in different regions reside in different virtual private clouds (VPCs). If you migrate data from Server A to Server B across regions, the underlying hardware may change, and hardware-locked application licenses may become invalid. You are responsible for checking whether your application licenses on Server A are hardware-locked.

Before you migrate data, take note of the following items:
  • The runtime environments in Server A and Server B must be of the same version.
    Some websites have strict requirements for the versions of server runtime environments. If the versions of the server runtime environments before and after the migration are different, the websites may not run normally. Make sure that Server A and Server B have images of the same version. If the servers have images of different versions, reset one of the servers. For more information, see Reset a simple application server.
    Note Scenarios for building websites are complex and diverse. After you migrate data, you must manually configure Server B based on your business requirements to ensure that the configurations on Server B are the same as the configurations on Server A. For example, if you have custom configurations for applications such as NGINX and Apache on Server A, you must manually configure these applications on Server B.
  • The public IP address changes after data is migrated from Server A to Server B.

    Different simple application servers have different public IP addresses. If you have bound a domain name to Server A, you must bind the domain name to Server B and resolve the domain name after data is migrated.

Migrate data between servers in the same region

This section describes how to migrate data from Server A to Server B when the servers are in the same region.

  1. Create a snapshot from Server A.
    To create a snapshot from Server A, perform the following operations. For more information, see Create a snapshot
    1. Log on to the Simple Application Server console.
    2. In the left-side navigation pane, click Servers.
    3. On the Servers page, click the card of Server A.
    4. In the left-side navigation pane, choose Server Maintenance > Disk.
    5. Separately click Create Snapshot in the Actions column of the System Disk and Data Disk sections.
      If no data disk is attached to Sever A, you can create a snapshot only for the system disk.
    6. In the Create Snapshot dialog box, verify the information, enter a snapshot name, and then click OK.
    7. In the left-side navigation pane, choose Server Maintenance > Snapshots to view the snapshot that you created.
  2. Create a custom image.
    To create a custom image, perform the following operations. For more information, see Create a custom image from a snapshot.
    1. Find the system disk snapshot that you created based on Server A and click Create Custom Image in the Actions column.
    2. In the Create a custom image dialog box, configure the parameters.
      The following table describes the parameters.
      Parameter Description
      Snapshot name The name of the system disk snapshot. This parameter value is automatically generated.
      Custom image name The name of the custom image. The name must be 2 to 128 characters in length and cannot start with a special character or a digit. The special characters that the name can contain are periods (.), underscores (_), hyphens (-), and colons (:).
      Custom image description The description of the custom image. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
      Data disk snapshot The snapshot of the data disk. This parameter is optional. If you want the custom image to contain the data on the data disk, select a data disk snapshot from the drop-down list. If you do not select a data disk snapshot, the custom image contains only data on the system disk.
    3. Click OK, and then click Go to View.
      On the Images page, you can view the custom image that you created.
  3. Check whether Server B already exists in the region where Server A is created.
    • If Server B already exists in the region where Server A is created, perform the following operations to reset Server B.
      For more information, see Reset a simple application server.
      1. In the left-side navigation pane, click Servers.
      2. On the Servers page, click the card of Server B.
      3. In the left-side navigation pane, choose Server Maintenance > Reset.
      4. In the Change to other images section, click the Custom Image tab.
      5. Select the custom image that you created in Step 2 and click Confirm Change.
      6. In the Change Image message, click OK.
    • If Server B does not exist in the region where Server A is created, perform the following operations to create Server B from the custom image.
      For more information, see Use a custom image to create one or more simple application servers.
      1. In the left-side navigation pane, click Images.
      2. Find the custom image that you created in Step 2 and click create swas in the Actions column.
      3. On the server buy page, configure parameters to create Server B.
        The system automatically configures the Region and Image parameters. You need only to configure other parameters based on your business requirements. The following table describes the other parameters.
        Parameter Description
        Instance Plan The plan for Server B. A default plan is displayed based on the size of the system disk data in the custom image. You can select a plan that provides higher configurations than the default plan. You are charged additional fees for the data transfer to the Internet beyond the plan. For more information, see Billable items and Billing of data transfers.
        Data Disk The data disk for Server B. This parameter is optional. You can customize the data disk size to have more storage space.
        Note If the custom image contains the data on a data disk, the default value of Data Disk is greater than or equal to the size of the data disk data in the custom image.
        Subscription Time The subscription duration of Server B. You can select Auto-renewal to enable the auto-renewal feature.
        Quantity The quantity of simple application servers that you want to purchase. Default value: 1. You can create up to 20 application servers.
      4. Click Buy Now and follow the on-screen instructions to make a payment.
  4. Verify the migration result.
    1. In the left-side navigation pane, click Servers.
    2. Click the card of Server B.
    3. In the Server Information section, view the public IP address of Server B. adasda
    4. On your computer, use the browser to access <The public IP address of Server B>/index.php. If you can find MantisBT, data is migrated from Server A to Server B.

Migrate data between servers across regions

This section describes how to migrate data from Server A to Server B when the servers are in different regions.

  1. Create a snapshot from Server A.
    To create a snapshot from Server A, perform the following operations. For more information, see Create a snapshot
    1. Log on to the Simple Application Server console.
    2. In the left-side navigation pane, click Servers.
    3. On the Servers page, click the card of Server A.
    4. In the left-side navigation pane, choose Server Maintenance > Disk.
    5. Separately click Create Snapshot in the Actions column of the System Disk and Data Disk sections.
      If no data disk is attached to Sever A, you can create a snapshot only for the system disk.
    6. In the Create Snapshot dialog box, verify the information, enter a snapshot name, and then click OK.
    7. In the left-side navigation pane, choose Server Maintenance > Snapshots to view the snapshot that you created.
  2. Create a custom image.
    To create a custom image, perform the following operations. For more information, see Create a custom image from a snapshot.
    1. Find the system disk snapshot that you created based on Server A and click Create Custom Image in the Actions column.
    2. In the Create a custom image dialog box, configure the parameters.
      The following table describes the parameters.
      Parameter Description
      Snapshot name The name of the system disk snapshot. This parameter value is automatically generated.
      Custom image name The name of the custom image. The name must be 2 to 128 characters in length and cannot start with a special character or a digit. The special characters that the name can contain are periods (.), underscores (_), hyphens (-), and colons (:).
      Custom image description The description of the custom image. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
      Data disk snapshot The snapshot of the data disk. This parameter is optional. If you want the custom image to contain the data on the data disk, select a data disk snapshot from the drop-down list. If you do not select a data disk snapshot, the custom image contains only data on the system disk.
    3. Click OK, and then click Go to View.
      On the Images page, you can view the custom image that you created.
  3. Copy the custom image.
    To copy the custom image that you created to the destination region, perform the following operations. For more information, see Copy a custom image.
    1. In the left-side navigation pane, click Images.
    2. On the Images page, find the custom image that you created.
    3. Click Copy Image in the Actions column.
    4. In the Copy Image dialog box, configure the parameters.
      The following table describes the parameters.
      Parameter Description
      Destination Region Select a destination region to which you want to copy the source custom image. Select Singapore in this example.
      Custom image name The name is used to identify the destination custom image. You can customize the name. The name must be 2 to 128 characters in length and cannot start with a special character or a digit. The special characters that the name can contain are underscores (_) and hyphens (-).
      Custom image description The default description consists of the region where the source custom image resides and the ID of the destination custom image. You can modify the description. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    5. Click OK.
      On the Images page, you can view the information of the custom image in the Copying state. Wait until the copy task is complete.
      Note The Instance Name information for the destination custom image is left empty.
  4. Check whether Server B already exists in the destination region.
    • If Server B already exists in the destination region, perform the following operations to reset Server B.
      For more information, see Reset a simple application server.
      1. In the left-side navigation pane, click Servers.
      2. On the Servers page, click the card of Server B.
      3. In the left-side navigation pane, choose Server Maintenance > Reset.
      4. In the Change to other images section, click the Custom Image tab.
      5. Select the custom image that you created in Step 2 and click Confirm Change.
      6. In the Change Image message, click OK.
    • If Server B does not exist in the destination region, perform the following operations to create Server B from the custom image.
      For more information, see Use a custom image to create one or more simple application servers.
      1. In the left-side navigation pane, click Images.
      2. Find the custom image that you created in Step 2 and click create swas in the Actions column.
      3. On the server buy page, configure parameters to create Server B.
        The system automatically configures the Region and Image parameters. You need only to configure other parameters based on your business requirements. The following table describes the other parameters.
        Parameter Description
        Instance Plan The plan for Server B. A default plan is displayed based on the size of the system disk data in the custom image. You can select a plan that provides higher configurations than the default plan. You are charged additional fees for the data transfer to the Internet beyond the plan. For more information, see Billable items and Billing of data transfers.
        Data Disk The data disk for Server B. This parameter is optional. You can customize the data disk size to have more storage space.
        Note If the custom image contains the data on a data disk, the default value of Data Disk is greater than or equal to the size of the data disk data in the custom image.
        Subscription Time The subscription duration of Server B. You can select Auto-renewal to enable the auto-renewal feature.
        Quantity The quantity of simple application servers that you want to purchase. Default value: 1. You can create up to 20 application servers.
      4. Click Buy Now and follow the on-screen instructions to make a payment.
  5. Verify the migration result.
    1. In the left-side navigation pane, click Servers.
    2. Click the card of Server B.
    3. In the Server Information section, view the public IP address of Server B. adasda
    4. On your computer, use the browser to access <The public IP address of Server B>/index.php. If you can find MantisBT, data is migrated from Server A to Server B.

What to do next

The public IP address changes because data is migrated from Server A to Server B. If you have bound a domain name to Server A and resolved the domain name, you must bind the domain name to Server B and resolve the domain name again after data is migrated. For more information, see Bind and resolve domain names.