Method 1: Detach EBS Volumes and Attach Directly This method only works within the same AZ. It only works with EBS. These steps are for the Management Console, but you could use the CLI with the run-instances, stop-instances, detach-volume, attach-volume, and start-instances commands.
Shut down the source instance
Detach all volumes from the source instance, making a note of their Device names (mount points) on the source
From the EC2 page, select Launch Instance
Step 1: Select the same AMI that the source was launched from
Step 2: Select a matching instance type
Step 3: Select the target subnet
At this point you can continue to configure (storage, tags, SGs) or you can Review and Launch
You’ll be taken to the EC2-Instances page. Once the target instance is ready, select it and go to Actions-Instance State-Stop
Identify the root volume and detach it from the instance
Attach all source volumes to the target instance, matching their Device names like they were on the source
Start the target instance again
When you are sure that you’re done with the source instance, you can terminate it and delete the new root volume that was discarded
Method 2: Create an AMI The steps listed here work only within the same region and account (with additional steps, this method could go across accounts and regions). They work for EBS or local (Instance Store) storage. They are for the Management Console, but you could also use the CLI with the create-image, register-image and run-instances commands.
From the EC2-Instances page, select the source instance and go to Actions-Image-Create Image
Image Name is required and limited to 127 characters
Note: If you do not shut down the instance, data consistency is not guaranteed
From the EC2 page, select Launch Instance
Step 1: On the left hand menu, select My AMIs and Select the image you just created
Step 2: Select a matching instance type
Step 3: Select the target subnet
At this point you can continue to configure (storage, tags, SGs) or you can Review and Launch
When you are sure that you’re done with the source, you can terminate the source instance, delete its volumes, delete any snapshots of those volumes, and deregister the AMI you created from it
Method 3: Snapshot the EBS volume(s) This method works cross-region and cross-account. It only works with EBS. These steps are for the Management Console, but you could use the CLI with the create-snapshot, copy-snapshot, modify-snapshot-attribute, create-volume, run-instances, stop-instances, detach-volume, attach-volume, and start-instances commands.
Note: If you want to snapshot the root or C:\ volume, you should shut down the instance first.
Make a note of all EBS volume IDs attached to the instance
From the EC2-Snapshots page, click Create Snapshot
Insert the volume ID, optionally a name and description, and click Create
Repeat for all volumes and wait for the snapshots to finish (status = completed)
(If moving to another region) Select the snapshot and go to Actions-Copy. Here you can select the region give a description. Repeat for all involved snapshots
(If moving to another account) Select the snapshot and go to Actions-Modify Permissions. Here you can insert the account number and set the account’s permissions. Repeat for all involved snapshots
Now, using the target account, recreate the root volume from the appropriate snapshot in the target region. Select the snapshot and go to Actions-Create Volume. The options will pre-fill to match the source volume. You can expand the volume here if you wish.
Note the snapshot IDs of any non-root volumes
From the EC2 page, select Launch Instance
Step 1: Select the same AMI that the source was launched from
Step 2: Select a matching instance type
Step 3: Select the target subnet
Step 4: For any non-root volumes, click Add New Volume and insert their snapshot ID and match their Device names (mount points) like they were on the source. This will recreate the non-root volumes as part of the launch
At this point you can continue to configure (tags, SGs) or you can Review and Launch
You’ll be taken to the EC2-Instances page. Once the target instance is ready, select it and go to Actions-Instance State-Stop
Identify the root volume and detach it from the instance
Attach the root volume created from the snapshot during step #7
Start the target instance again
When you are sure that you’re done with the source, you can terminate the source instance, delete its volumes, delete the snapshots of those volumes, and delete the new root volume that was discarded
Reading:
Social