Goodbye Joomla!

It took a little work, but I’m now migrated from Joomla to WordPress.  Here’s how I migrated:

  • Used Akeeba Backup to get a full backup of my Joomla site and download it locally.
  • Created a local linux virtual machine and installed Joomla, then restored the Akeeba backup.
  • Created another local linux virtual machine and installed Joomla.
  • Using the FG Joomla to WordPress tool, I migrated the site.
  • After migrating, I was able to do cleanup and customize the new site.
  • Created a backup of the new WordPress site using UpdraftPlus, then uploaded to my GCP instance.
  • Created a new Docker WordPress container and configured Nginx for the new container to support testing.
  • Restored the WordPress backup to the new container and did final testing and cleanup of the site.  One important step was fixing URL references in the database.  I connected to MariaDB and used these queries:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
  • To go live with the new site, it was just a matter of changing the back-ed port forwarding in Nginx.  Both the live and testing sites are forwarding to the same back-end container so all works as it should.
  • Then a final clean-up Nginx port forwarding and the database using the above SQL queries so that I can keep the testing site separate.
  • And of course, remove the Joomla container and database.

Going SSL

With all of the issues around web security, there’s a pretty easy solution using EFF’s certbot and LetsEncrypt.org.  I use an Nginx proxy in front of everything, so all of the encryption terminates there.  So using certbot with webroot was pretty easy and then it was just a matter of adjusting the Nginx config.

In each site that I migrated to SSL, here’s an example of what the final config looks like.  This works for both Joomla! and WordPress sites behind Nginx.  Nginx listens on http/80 and redirects to https/443.

server {
 listen       80;
 server_name  site_name.come www.site_name.com;
 return 301 https://$host$request_uri;
 }

server {
 listen       443 ssl;
 server_name  site_name.com www.site_name.com;
 ssl_certificate    /etc/letsencrypt/live/kuykendall.life/fullchain.pem;
 ssl_certificate_key  /etc/letsencrypt/live/kuykendall.life/privkey.pem;
 ssl on;

location / {
 proxy_set_header Host $host;
 proxy_set_header X-Forwarded-Host $host;
 proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://172.17.0.1:8082;
 proxy_redirect http:// https://;
 }

How this site operates

Here’s how this site is currently setup

– Single Linux server running in Google Compute US-East.
– The Google Compute instance started as an “n1-standard-1”.  I’ve added additional memory but have stuck with a single CPU.
– The only things installed in addition to the base OS are Git and Docker
– Dockerfiles and scripts to manage all of the containers are stored in a private git repo
– Backups consist of a snapshot in GCP and tarballs of data copied to Google Drive or downloaded locally.

This setup works pretty well and makes the whole thing pretty portable.  I had originally built all of this is US-Central but later decided to move it to US-East.  It was a pretty simple task of creating a new instance, installing git and docker, pulling the docker repo, copying the data into place, then creating the containers.

Continue reading