This guide demonstrates how to copy a snapshot of a Linux based instance to another region as well as attach a volume to a new instance to complete the instance data migration across regions.
1. Go to the AWS Console and select the EC2 Service. Go to the EC2 running instance dashboard and select the running Linux instance. It displays the instance meta data. Note the volume details of the instance. The instance is currently running in the US-West-2 (Oregon) region.
2. Login to the Linux instance. List the data of the instance.
3. Go to Snapshot in the EC2 console and select “Create Snapshot”. Provide the snapshot name, description and select the volume of the instance identified in step #1. Click on the “Create” button.
4. The snapshot has been created and is available in the Snapshot console.
5. Select the snapshot that the user wants to move to the other region. Right click on the snapshot and select the “copy snapshot” option.
6. Provide the target region and the description for the snapshot. Click on the button “Yes, Copy”.
7. The snapshot copy process will now commence. AWS will display the acknowledgement for the same and provide a link to go to the snapshot console of the target region. Click on the link or manually change the region to go to the target region snapshot console.
8. In the target region (EU-Ireland), the copy process is in progress. AWS will display the progress of the process.
9. After the process is complete, the snapshot will be available in the target region.
10. Create the volume from the snapshot.
11. Select the zone where the volume will be created and provide the remaining details. Click on the button “Yes, Create” to create the volume.
12. Launch a Linux instance in the same zone where the volume from the snapshot has been created.
13. Stop the instance. Detach the root volume of the new instance.
14. Once the root volume has been detached, attach the volume created in step #11 to the instance.
15. Attach the volume as the root volume by mounting on /dev/sda1(dont forget to change the device if it is not /dev/sda1).
16. Start the Linux instance and login to the instance. The instance will display the content similar to the US-West-2 Linux instance, as shown in step #2.
17. The above process completes the migration of the user’s instance from one region to another.
18. If the user wants to migrate the snapshot with the command line option, first set the EC2 command line tool.
Using AWS CLI Tools
19. Run the following command to list the current snapshots of the region:
ec2-describe-snapshots –region <Region Name>
To copy the snapshot data, the ec2-copy-snapshot command will be executed. The above mentioned command should be executed from the target region unlike the console UI where it is executed from the source region.
Run the command:
ec2-copy-snapshot –region <Target Region where the data will be copied> -r <Source Region where the snapshot is present> -s <Snapshot ID>.
20. The snapshot copy process will now commence, as explained in step #9.
21. Once the snapshot is available, run the command ec2-describe-snapshots –region <Region Name> to list the current snapshots of the region for getting the status of the snapshot.
Credit to: http://www.newvem.com/how-to-migrate-copy-ec2-instance-between-amazon-aws-regions/
No comments:
Post a Comment