How to migrate your WordPress website from a hosted provider to AWS.
- Download all the website files from the hosted server.
- Export your MYSQL database (be sure to select the option to include all tables) into a .sql file
- Create a MYSQL database in AWS RDS
- Using a database client – run the .sql file you exported.
- If you want to use the table you created in RDS, delete this line:
CREATE DATABASE IF NOT EXISTS <OLD DATABASE TABLE NAME> DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE <OLD DATABASE TABLE NAME>;
- If you want to use the table you created in RDS, delete this line:
- Create a Ubuntu 16.04 AWS EC2 instance. Follow the directions here.
- Instead of installing the WordPress tarball, move all the website files you downloaded from the previous hosted server, to
/var/www/html.
- Instead of installing the WordPress tarball, move all the website files you downloaded from the previous hosted server, to
- Update the
wp-config.phpwith the RDS database info.- Under
DB_HOSTinclude:3306after the RDS endpoint.
- Under
- Create a new Route53 hosted zone for your domain.
- Export your DNS hosted zone from GoDaddy DNS management.
- Import the exported .txt file into Route53.
- In the GoDaddy DNS management, change the Nameservers to the AWS Route53 Nameservers.
- Change the domain’s “A Name” to your EC2 instance public IP address.