Over a million developers have joined DZone.

How to Move Servers Between AWS Accounts

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

This is a short post about how to move your (EC2) server from one account to another. I got in this situation a few ago and wanted to move our WordPress server from one account to another. Of course I could setup a new clean WordPress instance (like I described here) and load an WordPress XML export into the new environment. But luckily it is much easier then that, with less risk of errors. The trick here is to create a personal AMI under the old account and share that AMI to the new account. With the new account you initiate a new EC2 instance based on the shared AMI. Here are all necessary steps including screen shots:

  • Select the EC2 instance in the ‘old’ account
  • After selecting the EC2 instance create an AMI out of it by selecting the corresponding action:
    Screen Shot 2013-03-10 at 13.52.39
    After selecting the EC2 instance create an AMI out of it by selecting the corresponding action.

  • Set the AMI permissions
  • After the AMI is created, select it in the AMI overview and press the ‘Permissions’ button:
    Screen Shot 2013-03-10 at 13.58.25

  • Add the AWS account ID of the ‘new’ account
  • To give the new account access to this specific AMI add it’s AWS account ID to this list:
    Screen Shot 2013-03-10 at 13.59.45
    You can find your account ID here

  • Select AMi with the new account
  • Log out of AWS with the old account and login with the new one. Now select the AMI option on the left side of menu and filter the AMI’s on ‘Private Images’:
    Screen Shot 2013-03-10 at 14.04.38

  • Create new instance based on the AMI
  • The final step is to create a new instance based on the AMI. After it is launched you have an exact copy of the same machine within the new account:
    Screen Shot 2013-03-10 at 14.07.43

Of course it is a good idea to create (regular) backups of the new instance and shutdown the instance in the old account so you don’t have to pay for that one anymore.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:

Published at DZone with permission of Pascal Alma, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}