AWS EC2 – How to Migrate AWS EC2 Version 1 Instance to Version 2

amazon ec2amazon-web-serviceslinux

I currently have a t2.medium EC2 instance running on AWS. I realized that I need to be able to use systemctl in my instance to correctly set up certbot. systemctl is only available on Amazon Linux 2 (https://aws.amazon.com/amazon-linux-2/)

The instance I currently have is hosting a web server, and contains credentials that I want to transfer to the new instance. The instance is also connected to other AWS services(S3, dynamoDB) via Amazon SDK. What's the best way to create this new instance and transfer all of my configuration files over?

Thank you!

Best Answer

An alternate solution is to keep your current server and use a different Let's Encrypt client. I use Acmetool, I have a tutorial here - though it might be a little out of date.

Amazon Linux makes installing quite a few packages difficult, and the AWS repositories aren't particularly up to date.