DEV Community

Cover image for Migrate from AWS EC2 to Lightsail

Migrate from AWS EC2 to Lightsail

David J Eddy on October 04, 2018

Cross posted from my personal blog https://blog.davidjeddy.com. As is good practice for any and all Cloud Engineers I am constantly looking for wa...
Collapse
 
benjaminblack profile image
Benjamin Black

I'm waiting for IPv6 before I will use Lightsail. I have been waiting for it since launch almost two years ago, and it's a little absurd that IPv6 wasn't supported at launch, in 2016, and still isn't supported.

Collapse
 
avasconcelos114 profile image
Andre Vasconcelos

Thank you for the article, I love seeing articles like these that help other folks instantly save costs on hosting their websites.

On a related note, I wanted to ask if there is any way to use https on LightSail without resorting to use their load balancer?

It's been costing me about $17/month, but it simply would not work without it when I tried to set it up with certbot

Collapse
 
david_j_eddy profile image
David J Eddy

Thank you Andre, glad you liked the article! Certbot should do the trick for you, it is how I do SSL on both Ubuntu 16/18, AMI (v2 does not work with cerbot w/o a LOT of work yet).

Send me a private message with your setup, may I can help.

Collapse
 
avasconcelos114 profile image
Andre Vasconcelos • Edited

Funny story went on here.

So I thought I had been setting up certbot wrong, as every time I tried testing if the page worked, the page would hang and the console would show its request status as pending.

What actually happened is that even though I opened up the ports in the server with sudo ufw allow 'Nginx Full', I hadn't set it up in the network tab on the lightsail screen. Going over to the Network options and adding the HTTPS option to the allowed ports fixed my issue!

Thank you once again as your article was the thing that finally made me want to fix the loadbalancer issue (and started saving me $18 every month!)

For reference, here's an image of the settings I had to add:

Thread Thread
 
david_j_eddy profile image
David J Eddy

:D Yea, Security Group's get me every time. Spent an hour recently trying to figure out why a site was return 504 Gateway Timeout. Turned out someone removed the SG's access to the RDS database. The language was timing out trying to connect to the DB so Nginx return 504.

Glad this helped out in some small way.

Collapse
 
latchuliz profile image
latchuliz

Here I having one staging server on AWS EC2 Ubuntu instance. But i want to migrate from EC2 instance to light sail. Is this possible? This is java based project. I want to copy all the data's and configuration files from EC2 to AWS light sail. I don't know how to do? Please tell me the procedure to do. It's urgent. I'm waiting for your reply

Collapse
 
david_j_eddy profile image
David J Eddy

I would not do this migration. EC2 is a much better option for commercial applications. Personal website, family photo gallery, low-budget / not-critical: LightSail.

If the application is a commercial product; go with EC2.

Collapse
 
lcdollarhite profile image
lcdollarhite

Mistype for route 53 at the beginning of the article.

Thank you for the insight into your migration experience.

Collapse
 
david_j_eddy profile image
David J Eddy

Good eye! Thank you for the correction.

Glad you liked the article.

Collapse
 
latchuliz profile image
latchuliz

How to move all data's and configuration files from EC2 instance to AWS Light sail? Please let me know if any procedure to follow. I want to move from EC2 instance to Light sail.

Collapse
 
david_j_eddy profile image
David J Eddy

While I have not attempted this type of migration personally; one idea that comes to mind is to copy the file system contents you wish to keep to S3 as an archive.

On LightSail download and expand the archive where you need it on the LightSail instance.

Please see my other comment concerning use of LightSail; TL;DR: LightSail should NOT be used for mission critical commercial applications.

Collapse
 
marataziat profile image
marataziat

Has google cloud this thing?

Collapse
 
david_j_eddy profile image
David J Eddy

I do not believe GCP has as similar offering for simplistic VPS hosting. However, I do know GCP does compute, database, and DNS. Just not in such a simple interface.