Tuesday, February 21, 2023

Howto: Upgrade(Migrate) Your t2.micro EC2 instance

My first EC2 instance was created in 2015, and was a t2.micro for Free Tier. I've been using it for testing.

Since it's been years so I'm no longer eligible for Free Tier, so I keep paying for it.
Until recently I found that I need it to be faster and with larger storage (it was 30GB for Free Tier).

Googled for how to migrate your EC2 instance and saw many TLDR documents, not sure why do they have to use such a long article instead of an easy step by step instructions.

Here's how I done it with AWS console:

  1. From EC2 panel, stop your instance, then detach the EBS storage.
  2. From "Volumes", select the volume then create a snapshot.
  3. From "Snapshots", select the snapshot then create a volume from snapshot. Then you can put a bigger number for the volume size.
  4. From "Instances", launch a new instance. Choose the instance type you want, and leave the "Storages (Volumes)" alone. Reuse the same key as previous EC2.
  5. Stop the instance after it's created and started.
  6. Detach the attached storage. It's the one create along with new instance.
  7. Attach the volume you created from snapshot.
  8. Start the instance.
  9. Winning.

Note: The etc/ssh/sshd_config might be reset, so you won't be able to login by password if you used to. Have to change the config to allow password authentication 

No comments:

Post a Comment