Ever wanted to move an Amazon EC2 instance from one Availability Zone (AZ aka Region) to another? Maybe you want to quickly replicate your entire server for delivery to users in Asia, North America (East or West coast) or you want to branch out with a new AZ in Europe?
Whatever your reasons for doing so, perhaps the easiest way in which this may be achieved, without recourse to any command line techniques, could be through the use of EBS Snapshots.
The following process will get you where you need to be.
Open your AWS control panel on the availability zone of your existing EC2 instance.
Visit the EBS (Elastic Block Storage) section, in the menu to the left, and open the Volumes section.
Here, you will discover all of your EBS volumes which are currently in use. It should be obvious which volume is attached to the instance you’d like to copy. It will say, explicitly, which device it is attached to!
Right-click the one you’re looking to move to a new AZ, and select “Create Snapshot” – you’ll be faced with some options. Don’t change the device – this is the one you just selected! But DO be sure to give your snapshot a good name. Like “domaindotcomoctober15snapshot” or something obvious. You might find this very very useful later.
Now, perhaps the easiest way to build a new instance in this one’s image is to create an image – or AMI – of the snapshot you just took and copied. Do that by going to the Snapshots page, right-clicking the snapshot you just made (as long as it is ready!), and selecting “Create Image From Snapshot”. Give your snapshot a name, and be sure to select the correct options (such as architecture, root device and etc, where relevant).
Navigate to the “Instances” screen in the region you’d like to crank up, and then select “Launch Instance”. In the instance launch wizard, on the very first screen, you will see the option to use “My AMIs” – click that, and you should see the image you just created! Click that, configure your options, and you are away!
After that, just re-point your public IP address, or create a new one, update your domain a-records or whatever other DNS magic you need to work, and you’ve done the job you wanted!
Leave a comment below if this works – or doesn’t work – for you. The more detail the better. There are other ways of doing this (including copying your snapshot to another region / building an EBS volume based on that, and attaching THAT to an EC2 instance, but that would appear to be a little long-winded…).
