Continuous iterations of Elastic Compute Service (ECS) instances give rise to issues with instances that were created a long time ago. For example, old instances may run short of resources. This affects the O&M efficiency of your cloud-based business. To ensure that you can manage and operate your cloud-based business in an efficient manner, we recommend that you use the snapshot and image features to migrate data from an old instance to a new instance.

Background information

Alibaba Cloud snapshot is an agentless data backup feature that backs up or restores data for entire disks. For more information about snapshots, see Snapshot overview. Custom images are created based on snapshots of ECS instances. You can quickly create identical ECS instances from a custom image. For more information about custom images, see Overview.

You can perform the following procedure to migrate instance data by using the snapshot and custom image features:

Notes

Before you migrate instance data, take note of the following items:
  • Snapshots cannot be created for some instances that use local storage. The procedure described in this topic cannot be used to migrate data to or from such instances.
  • Source instances can be located in the classic network or virtual private clouds (VPCs).
  • Destination instances can be created only in VPCs.
  • Only instance types available within the selected zone can be used to create destination instances.
    Note If you want to migrate instance data across zones or regions, we recommend that you plan resources in the source and destination zones or regions in advance.
  • After you use the snapshot and image features to migrate instance data, disk data on the destination instance is the same as that on the source instance, but new metadata is generated for the destination instance and is different from that of the source instance. For more information about instance metadata, see Overview of ECS instance metadata.
    Before you migrate instance data, we recommend that you manually sort out resource associations so that you can update resource associations accordingly in a timely manner after migration. Examples:
    • Assume that instances use private IP addresses to communicate within a cluster. After you migrate data from one instance to another within the cluster, you must replace the private IP address of the source instance with that of the destination instance so that the destination instance can communicate with other instances in place of the source instance.
    • The licenses of some applications are bound to the media access control (MAC) addresses of instances. After you migrate data from one instance to another, the licenses bound to the MAC address of the source instance become invalid, and you must rebind the licenses to the MAC address of the destination instance.

Step 1: Create a custom image from the source instance

Before you create a custom image from the source instance, make sure that you have understood the items that you must take note of. For more information, see Create a custom image from an ECS instance. When the system creates a custom image from the source instance, the system creates a snapshot for each of the disks attached to the instance. These snapshots are billed based on the storage they use. For more information about the billing of snapshots, see Snapshots.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the source instance and choose More > Disk and Image > Create Custom Image in the Actions column.
  5. In the Create Custom Image dialog box, configure parameters and click Create.
    You must specify the Custom Image Name and Custom Image Description parameters. You can optionally specify other parameters based on your business requirements.
  6. In the left-side navigation pane, choose Instances & Images > Images.
  7. On the Custom Image tab, find the custom image that you created in the previous step and check its state.
    If multiple custom images are displayed on the Custom Image tab, you can search for the custom image by name. When the custom image is in the Available state, you can proceed to the next step.

Step 2: (Optional) Copy the custom image to a different region

If you want to migrate data from the source instance to a destination instance that is located in a different region, you must first use the image copy feature to copy the custom image that you created in Step 1 to that region. For more information, see Copy custom images.

After the custom image is copied to the destination region, you must perform the subsequent steps in that region.

Step 3: Create a destination instance from the custom image

  1. In the left-side navigation pane, choose Instances & Images > Images.
  2. In the top navigation bar, select a region.
    If you have performed Step 2 to copy the custom image to a different region, switch to that region.
  3. On the Custom Image tab, find the custom image that you created from the source instance.
    If you have performed Step 2 to copy the custom image, find the image copy.
  4. In the Actions column, click Create Instance.
  5. On the instance buy page, configure parameters to create an instance to use as the destination instance.
    For information about how to create an ECS instance, see Create an instance by using the wizard. When you create the destination instance, take note of the following items:
    • In the Basic Configurations step, the parameters in the Image and Storage sections have been automatically specified and do not need to be modified. Custom image settings
    • In the System Configurations (Optional) step, set Logon Credentials to Inherit Password From Image.
      Note After your set Logon Credentials to Inherit Password From Image, you can use the same password to log on to the created destination instance and the source instance.
      Inherit Password From Image

Step 4: Check data in the destination instance

You must check the data in the destination instance to ensure that services can continue to run smoothly on the destination instance after migration. Examples:
  • You must check the data integrity of the destination instance based on the data in the source instance.
  • You must compare resource information between the source and destination instances and update the resource associations for the destination instance. For information about how to view instance information, see View instance information or View instance metadata.

Step 5: (Optional) Release or delete the source instance and its resources

After you perform the following operations, you can release or delete the source instance and its resources to avoid unnecessary costs: Verify that data on the destination instance is the same as that on the source instance, update resource associations for the destination instance, and make sure that services can continue to run smoothly on the destination instance.
Notice The instance release, snapshot deletion, and image deletion operations are irreversible. When an instance is released or after a snapshot or image is deleted, data in the instance, snapshot, or image is deleted and cannot be recovered. Make sure that you release or delete resources only after all business data is migrated.
  • For information about how to release an instance, see Release an instance.
  • For information about how to delete a snapshot, see Delete a snapshot.
  • For information about how to delete a custom image, see Delete a custom image.
    Note After a custom image is deleted, instances that are using this image cannot have their system disks initialized. If your custom image is free of charge, we recommend that you do not delete it. For information about the billing of images, see Images.