Aside

Notes on AWS Migration

Migrating a WordPress blog from GoDaddy to Amazon Web Services Hosting with Bitnami.

Having recently moved several sites, including this one, from GoDaddy to Amazon, I thought I’d share the process. I’m indebted to several other such blog posts whose tutorials pointed the way. (TODO: add links). I will assume, for those readers following this post, that you already know how to create an Amazon account, and that you have at least a passing familiarity with (or the ability to look up) Linux command line operations.

The first step is to spin up an Amazon EC2 instance on your account. When you choose your Amazon Machine Image (AMI), you have a huge variety of options, especially for WordPress. I recommend using the 1-click Bitnami WordPress AMI from the AWS Marketplace (TODO: add link and AMI #) – this is a free, stable release that is well-integrated into (indeed, designed specifically for) WordPress on AWS.

TODO: add screenshot

When you launch the instance, you’ll have to assign it a key pair for security. Be sure to save the private key in a safe place, because you only get one shot to download it.

TODO: add screenshot

Security Group: SSH by default. Add ports 80 (HTTP), 21 (FTP), and SFTP, and 3306 (MYSQL) access set up.

Assign an Elastic (static) IP address to the instance, so that you can access it from anywhere more easily – but be aware that if you need to shut down the instance, the IP address will release from it, and you’ll have to reassign it.

Open an SSH tunnel to the instance (user: bitnami, key: private key)

Open an FTP connection to the instance (same credentials)

TODO: add screenshot

 

TODO: add screenshot

export db (incld add-drop tables) from old
export content (wp exporter)
copy wp-content folder (tarball works well)

replace bitnami wp-content/ with the backup from the old one (ftp) (unzip or tar x*f on the new site)
import db via phpmyadmin (plugin)
import content via importer (plugin)

*delete ipconfig file*

if you have to change file permissions/ownership:
wp-content gets 0775, owner is bitnami, group is daemon.

backup and edit httpd.conf
– name of admin, allow override all, include wordpress.conf and virtual hosts.conf
httpd-vhosts.conf
– virtual host using name of site, point to wordpress/htdocs document root

– create a second virtual host with the temporary name of the site?

backup and edit wordpress.conf
– instead of htaccess file

sudo vi /opt/bitnami/apps/wordpress/conf/wordpress.conf

– set rewrite mod rules to /wordpress/

 

mysql – table wp-options
– siteurl and -home to
– 127.0.0.1/wordpress/

restart apache and mysql

fix breaks:

– front-end settings; just put the two sites side by side.
– duplicate content from importer, esp. menus
– links: esp. relational vs hard links if domain is changing (incld. directory structure e.g. example.com/blog/ into example.com/)
– images: likely bad links if wp-content and db are both imported
– plugins: this is the big one esp. if there are server config tweaks necessary. case by case basis.

dns change: a record
– point @ to AWS elastic IP
– try to keep old one as cname or subdomain a record

backup and edit wp-config.php

– to name the site

shaboom

Leave a Reply

Your email address will not be published. Required fields are marked *