Amazon AWS EC2 – Move instance to other region
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
- Stop instance to move to another region
- Make snapshop (you can restart your original instance and put it back in production)
- Make new volume of snapshot
- Start another instance
- Attach the volume from the snapshot to the newly started instance
- (on the temp instance in the source region) Mount the volume to the instance
- Start an instance in the target region
- Create a volume of the same size as your source volume in the target region in the same availability zone as your target instance.
- Attach the just create volume to the target instance
- (on the target instance) Format the attached volume with the same file system as the source instance.
- (on the target instance) Mount the target instance
- (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.
- (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 - (on the target instance) Unmount the volume
- Detach the volume
- make a snapshot
- make an image
- start the instance. DOESNOT WORK. Don’t know why.