How do I move/ migrate a Cloud9 environment from one AWS account to another?

After my investigation, I noticed that Cloud9 does not provide the functionality to move an environment from one AWS account to another. However I found a workaround by sharing the snapshot of Cloud9 instance from one account and creating a new Cloud9 environment with this snapshot in another account. You can find detailed steps below.

1. In AWS account A, find the cloud9 instance on EC2 console (it is usually of format aws-cloud9-<environment_name>-XXXXXX), click the link of Block devices on Description tab and then click the link of EBS ID.

2. Create a snapshot by clicking “Action”–>”Create Snapshot”.

3. Once the snapshot is created, share this snapshot to AWS account B. Please refer to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html .

4. Login to AWS account B

5. Create a Cloud9 environment, please refer to https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment.html.

6. After creating new environment, move to the EC2 console and stop the new Cloud9 instance.

7. With this new instance, click the link of Root device on Description tab and then click the link of EBS ID.

8. Detach this volume (Action–> Detach Volume), make sure the instance is in “stopped” state.

9. Locate the snapshot shared from step 3. (open the EC2 console, choose Snapshots in the navigation pane, choose the Private Snapshots filter)

10. Click on the snapshot and create a volume. Make sure this volume is in the same availability zone as the new Cloud9 instance.

11. Find the volume created on step 10, click Action–>Attach Volume, then choose the new Cloud9 EC2 instance and use “/dev/xvda” for Device field. Click Attach button then.

12. Open the Cloud9 console, by clicking Open IDE button, you should be able to see the migrated environment in account B.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *