AWS Cloud General

How to migrate your wordpress blog from Bluehost to Amazon Lightsail

My first blog post was created back in April 25, 2014. I had used Godaddy before but I wanted to try a different host. After my research I decided to host a WordPress blog using Bluehost. Bluehost is a great host and I highly recommend them. One of the great features they have is automatic backup of your WordPress site and MySQL database.

Why migrate?

Lately, I’ve been studying to take the AWS Certified Developer Associate exam. To force myself to learn AWS in depth, you have to use it frequently. That’s why I decided to migrate my blog from Bluehost to Amazon Lightsail. With Lightsail, it is very simple to create a WordPress site. You select the WordPress for your instance image, select a plan, and finally name your instance.

Here are the steps I took to migrate my WordPress blog from Bluehost to Amazon Lightsail:

Website Backup

Since Bluehost provides daily backups of my WordPress site, the only thing I had to do was download the public_html folder. This folder contains all files needed to run WordPress. If you are using a different host, you can find your WordPress folder by searching for wp-admin, wp-content, and wp-includes folders. Once you find these folders, backup the parent folder.

MySQL Database Backup

For the database backup, I also downloaded the backup files provided by Bluehost. There is a sql script to create the database and another sql script that contains the actual data we want to migrate to Lightsail. In my case, I only kept the file that contains the insert statements to migrate the data.

Create Lightsail Instance

This is a simple process. Go to Amazon Lightsail console, and click on Create Instance. Then select Apps + OS, WordPress, select a plan, and name your instance. It is that simple.

Setup FTP Access

By default, Amazon Lightsail has ports 22, 80, and 443 open. However, if you try to connect to your instance, it will not work. To have FTP access to your instance, download your default private key. Once you have the .pem file, upload it to your FTP client. In my case I used Filezilla and was able to connect and copy files.

Copy files and Migrate Data

Since Amazon Lightsail created a new WordPress site, I refused to restore those files from my Bluehost backup. I compared both sites and I noticed files that were only used by Bluehost. I decided to only copy files needed for this migration to work. The first file was wp-config.php, which contains the database username, password and other settings. I modified this file to contain Lightsail’s database information. I also copied the sql script to migrate the data. After copying this file, I was able to connect using SSH and ran the script against the MySQL database.

DNS Changes

With the data migrated from my old Bluehost database to the new database, it was time to make the DNS changes. I first went to Bluehost and update the nameservers to point to Amazon. After doing that, I created a DNS zone in Lightsail console and A records for solutionsbyraymond and

As you can see, it was a very simple process to migrate from Bluehost to Amazon Lightsail. At the beginning it took hours to read the documentation but at the end I had no issues with the migration. I hope this helps other developers trying to migrate to Lightsail.