Move servers between AWS accounts

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.

About Pascal Alma

Pascal is a senior IT consultant and has been working in IT since 1997. He is monitoring the latest development in new technologies (Mobile, Cloud, Big Data) closely and particularly interested in Java open source tool stacks, cloud related technologies like AWS and mobile development like building iOS apps with Swift. Specialties: Java/JEE/Spring Amazon AWS API/REST Big Data Continuous Delivery Swift/iOS
This entry was posted in AWS and tagged . Bookmark the permalink.