Cloud Zone is brought to you in partnership with:

Pascal is a senior JEE Developer and Architect at 4Synergy in The Netherlands. Pascal has been designing and building J2EE applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Specialties: JEE XML Web Services Mule ESB Maven Cloud Technology Pascal is a DZone MVB and is not an employee of DZone and has posted 56 posts at DZone. You can read more from them at their website. View Full User Profile

How to Move Servers Between AWS Accounts

  • submit to reddit

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.

Published at DZone with permission of Pascal Alma, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)