How to Migrate WordPress to AWS

yogesh beth
Petabytz
Published in
5 min readSep 14, 2019

1. Launch an EC2 Instance

From your EC2 dashboard, click on the Launch Instance button to deploy a new EC2 instance.

Now that your EC2 instance has been deployed, the next step is to install WordPress. To to this, navigate to AWS Marketplace in the left sidebar column, then search for WordPress and select WordPress Certified by Bitnami.

Click the Continue button after you’ve looked over the Bitnami WordPress details page.

2. Choose Instance Type

3. Configure Instance Details

On the Configure Instance Details page, choose the Auto-assign Public IP option, and leave the other options unchanged.

Review Instance Details

Generate SSH Key

Obtain WordPress Credentials

login to your new WordPress installation,On your Instances page, click on the Actions button, then navigate down to Instance Settings then click on Get System Log.

Use the sidebar at the right side of the page to navigate towards the bottom of the instance log. Locate and copy your Bitnami application password.

Copy External IP Address

Login to WordPress

In a new browser window, paste the Public IP address followed by wp-admin — this willl take you to the WordPress login page. Enter user as the username, and paste the password that you copied from the previous step into the password field.

That’s it! You’ve successfully logged in to WordPress!

Transfer Domain Name

Create a Hosted Zone

On the Create Hosted Zone page, enter your domain name in the Domain Name field, then click the Create button to create a new hosted zone.

Add “A” Record

In the Type field, select A Record, and paste your public IP that you copied in one of the previous steps into the Value field, then click the Create button at the bottom of the page.

4. Add “CNAME” Record

Enter www in the Name field, and select CNAME as the record type. In the Value field, enter your domain, then click on the Create button

5. Edit Domain Name Servers

Test Settings

Include WWW. Prefix

In order to add the www. prefix to your domain, you will first need to configure an SSH client to connect to your EC2 instance.

sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

sudo /opt/bitnami/ctlscript.sh restart apache

Import WordPress Website

Download WP Migration Plugin

From your existing WordPress website (the one you want to transfer to AWS EC2), head over to “Add Plugins” and download the All-in-One WP Migration plugin.

Activate the All-in-One WP Migration plugin, and access it by clicking the link in your WordPress sidebar column. From the All-in-One WP Migration dashboard, select Export To > File.

From your new WordPress Website installation, download the All-in-One WP Migration plugin and go to Import From > File.

Choose the export file that you downloaded in the previous step.

Change Permalink Structure

After you’ve successfully imported your WordPress website to Google Cloud, you will need to reset your permalink structure. From your WordPress dashboard go to Settings > Permalinks, and select the permalink structure that you prefer (I recommend post name).

--

--