Amazon AWS EC2 – Move instance to other region

Standard

By far the simplest way to transfer/copy/move instanaces between AWS regions is to use the Ylastic interface.

It is US$20 and when you transfer there are costs for traffic and a temporary control instance (which you also will have with the method below). However Ylastic makes this a 5 minute understand and setup process. And it works even for Windows instances.

 

Preparation:

In AWS web console

  1. Stop instance to move to another region
  2. Make snapshop (you can restart your original instance and put it back in production)
  3. Make new volume of snapshot
  4. Start another instance
  5. Attach the volume from the snapshot to the newly started instance
  6. (on the temp instance in the source region) Mount the volume to the instance
  7. Start an instance in the target region
  8. Create a volume of the same size as your source volume in the target region in the same availability zone as your target instance.
  9. Attach the just create volume to the target instance
  10. (on the target instance) Format the attached volume with the same file system as the source instance.
  11. (on the target instance) Mount the target instance
  12. (on the target instance) make sure you can access the temp instance in the source region via SSH – disable any keys and change ssh_config in the temp instance in the source region etc, if you have to.
  13. (on the target instance) Copy files from the temp instance the source to the mounted volume on the target with rsync:
    rsync -PHAXaz -e ssh ec2-107-22-76-156.compute-1.amazonaws.com:/mnt/sdf1/ /mnt/sdf1
  14. (on the target instance) Unmount the volume
  15. Detach the volume
  16. make a snapshot
  17. make an image
  18. start the instance. DOESNOT WORK. Don’t know why.