Moving / Copying an Amazon EC2 Instance from One Availability Zone (Region) to Another

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…).

6 thoughts on “Moving / Copying an Amazon EC2 Instance from One Availability Zone (Region) to Another”

  1. This did not work for me for some reason. I was trying to move from a t1.micro to a t2.small instance. After launching the t2.small instance with the micro’s snapshot, it keeps crashing even before it’s accessible.

    Any ideas? I have a simple wp blog.

    Reply
    • Hi Ash,

      You could be over-thinking this – to update the instance type, you simply:

      1) Go to your EC2 management console in AWS;
      2) Right click on the running instance you’d like to alter;
      3) Instance state > Stop (to stop the instance running);
      4) Right click again – Instance Settings > Change instance type > Select new instance type > hit “Apply”
      5) Restart your instance.

      Done!

      Reply
  2. Hi,
    I used your ref as a guild but I had some problems:
    1. “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!” – NOPE 🙂 in the original region I can see my AMI but switching to the new region, I can’t see it, why is that??
    2. what can I do if I used the free tier AMI in the original region but the target region doesn’t have the same free tier setup?

    Thanks!

    Reply
    • 2 points:

      1) I think the AWS panel has changed since this was first written; and
      2) You might need to make your AMI available in the new region (try right clicking).

      On your second question, the usage tier you use doesn’t change based on your AMI – you can change your instance size regardless of what is on it. So you can make the AMI on a tiny or a HUGE instance. It makes sense to use the cheapest instance that will suit the needs of your application / OS / stack or whatever you have running on there!

      Reply
      • Hi,

        Yes, it has changed. All you need to do is to right click on the AMI’s image and click “Copy AMI”.
        From there you can choose the destination zone.

        Cheers

        Reply

Leave a comment

No links of any kind allowed in comments - if you add any links, your comment will automatically be deleted.