Backup and restore…

Red Blue Pill

Backing up and restoring a WordPress website almost seems too easy!

Seriously though, I didn’t have to hunt down a tutorial or anything. It’s pretty straight forward. Follow me!

It’s a simple 2 step process:

• First, you have to backup your website root directory folder.

Since I have three virtualhosts, I just copied and pasted each site directory folder side by side next to the live folder.

Note that “- Copy” is automatically appended to the directory name to tell them apart:

Duplicated Folders

• Second, you need to backup your corresponding databases for your website or virtualhosts.

Only 2 of my sites are using WordPress with SQL databases. I was able to use phpMyAdmin GUI to export them:

Export SQL

Optionally, you can use SQL CLI console to export them:

mysql> mysqldump -u [uname] -p[pass] db_name > db_backup.sql

You can save the .sql databases in the same directory as the virtualhost directory backups. Most likely I’ll move these to external storage:

SQL Backups

Of course, it has to best tested!

I deleted the site directory and dropped the SQL database with phpMyAdmin GUI:



Optionally, you can use SQL CLI console to drop them:

mysql> DROP DATABASE databasename;

Finally, restore the directory by duplicating the backup folder and remove”- Copy.” Import the corresponding .sql backup database in phypMyAdmin:

Import SQL DB

Optionally, you can use the SQL CLI console to import them:

mysql> use DATABASE_NAME;

mysql> source path/to/file.sql;

Now that I can easily backup and restore, I don’t have to pay a plugin provider to do it for me and I can explore the limits of WordPress by tinkering with anything and everything, breaking it over and over, and restoring it. Thanks anyway, JetPack.

Enable Backups

Modifying themes…

Before I test a manual site backup and restore (not using plugins,) I thought I would play around a little bit with my site theme and customize it to my liking. I got myself into more work than expected. That’s usually the case.


There were a few things I wanted to alter to focus on readability, but I didn’t necessarily want to switch the entire theme of the website from light to dark. That would be the complete opposite of my intent, ruining everything with high contrast.

I wanted the main content wrapper to remain the classic white background with black text. I wanted to make the main nav and the footer a dark color to redirect attention to the main content. Since I’m taking two different approaches to contrast; icon color, hyperlinks, and selection color has to be complimentary to the background color….what a wild ride. Not to mention, I now know what a colophon is!

Some edits have to be made to the footer.php file. The “custom css” editor built into the admin appearance panel, adds css edits to the site database. I didn’t want to be altering the main theme’s style.css file directly either. This meant I had to create a child theme.


I was able to setup a child theme for each virtualhost following the directions from the WordPress Codex. It’s actually pretty simple (minus hunting for the wp_enqueue_style() parent function call) to create a new theme directory, copy the code for a styles.css and functions.php that uses the “parent theme” as a dependency at page load, done.

Any alterations can now be made directly to the respective css files in the child theme, without affecting the parent theme! Any customization will now be  unaffected by theme updates! This is the way it should have been from the beginning…. No more of that ‘paste everything here’ custom css editor blob.

Now about that backup and restore… Maybe I’ll save that until next week!

A few hosting updates…

Server optimization continues

I’m continuing to tweak and modify the WAMP and WordPress server configurations, to optimize site performance using as my benchmark. I’m realizing this is more of a journey, rather than a destination. 😀

WAMP tweaks include the following:

• httpd-vhosts.conf modified with mod_rewrite rules and wildcard ^(.*)$ to write any incoming requests to one of my 3 virtual hosts (,, or A 301 redirect for mistyped URLs may help with traffic.

• httpd-vhosts.conf modified to include IPv6 queries. Sites are now running dual stack IPv4/IPv6. GoDaddy DNS AAAA records added.

GoDaddy SBS DNS Service configured as DDNS if Spectrum changes home IP address. Not sure if this service will update IPv6 AAAA record yet!

• .htaccess modified in each site root directory to enable caching with Apache mod_expires, and php opcache.

• .htaccess modified in each site root directory to enable compression with mod_deflate and mod_filter.

WordPress plugins:

• Implementing the Google Mail API with OAuth 2.0 using Post SMTP and Contact Form 7

• Integrating Google Analytics with GADWP

• Optimizing caching even more with WP Super Cache

• SEO with Yoast

Jetpack (of course)

Next on the agenda is attempting a full website backup and restore (directory and database.) I will feel much more comfortable making major design changes once I know I can manually revert to a past snapshot!