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.
- Read the notes carefully before you migrate instance data. For more information, see Notes.
- Step 1: Create a custom image from the source instance.
- Step 2: (Optional) Copy the custom image to a different region.
- Step 3: Create a destination instance from the custom image.
- Step 4: Check data in the destination instance.
- Step 5: (Optional) Release or delete the source instance and its resources.
Notes
- 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.
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
Step 4: Check data in the destination instance
- 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
- 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.