Today I migrated my wordpress server which was hosted on GCP to AWS. I had 3 months of free trial on GCP and it is getting over today. Though I was not billed, the cost per month for running a simple word press on Google Cloud comes around 1000 INR per month. May be with reservation for 1 year or 3 years, the overall cost could come down. The compute engine I used was e2-small with 10Gb boot disk. The compute engine cost was around 800 INR, VM Manager and Networking cost around 130 INR each.

I am planning to observe the cost in AWS for a month. I used EC2 – t2-micro, in ap-south region with 8gb boot disk. I initially thought of using one of the AWS migration services (application migration and database migration), but manual migration looked super easy and it was ChatGPTs recommendation too.
- SSH into Google Compute Engine – Google Cloud Cli can help ssh into the remote machine.
- Create a tar file for /var/www/html folder -> tar -czvf wordpress-backup.tar.gz /var/www/html/wordpress
- Use mysqldump to export the database -> mysqldump -u root -p wordpress_db > wordpress_db.sql
- Secure Copy these two files to your local pc
- From local pc, scp these files to AWS EC2. You could scp directly from gcp to aws, if your EC2 is already running with ssh ports open.
- Install apache2, mysql_secure_installation, certbot on EC2.
- Create db, user in mysql as below
- sudo mysql -u root
- mysql> ALTER USER ‘root’@localhost IDENTIFIED WITH mysql_native_password BY ‘YOUR_STRONG_ROOT_PASSWORD’;
- mysql> CREATE USER ‘wp_user’@localhost IDENTIFIED BY ‘YOUR_STRONG_USER_PASSWORD’;
- mysql> CREATE DATABASE wp;
- mysql> GRANT ALL PRIVILEGES on wp.* TO ‘wp_user’@localhost;
- mysql> EXIT
- Import the wordpress_db.sql –> mysql -u wp_user -p wp < wordpress_backup.sql
- Untar the wordpress-backup.tar.gz and set the permissions as below
- sudo chown -R www-data:www-data /var/www/html/wordpress
- sudo chmod -R 755 /var/www/html/wordpress
- As this is migration, changes to *.php files are not required w.r.t domain name, server name etc.
- Generate the certs – sudo certbot -apache
- Restart apache and mysql
- sudo systemctl restart apache
- sudo systemctl restart mysql
- Update your public/elastic IP address in your domain provider – Eg. godaddy.com – You could do this as first thing once your EC2 is ready with an elastic IP address as the DNS propagation could take some time.
- The wordpress themes, plugins, posts with images will be available and there will be no need to setup MFA again.
If AWS turns out costly, there are other cloud providers (linode, oracle) and hosting providers for wordpress that provide better plans – 129 INR / month for 2 years, 89 INR / month for 3 years. But we need to check the ease of migration. Some of the providers, they take care of migration and we have to submit the details of our current wordpress environment (which you may not want).