WordPress Tips You Really Should Know, Part I: Backups

Posted: February 4th, 2010

Photo by Eric M Martin (Flickr)

Photo by Eric M Martin (Flickr)

Many of us who have our own blogs also do all the maintenance on it. So while I could go on all day about how those nifty Twitter or image plugins can do this or that, you are better off with some tips that you really need to know if you are a do-it-yourself with WordPress.

This will be the first part of three posts on the topic. So here we go.

First, I will assume you are familiar with FTP software to access the WordPress files on your server. Note that I’ll be referring to FileZilla, which is free to download and can be used on all platforms.

Part I: WordPress Backups

A couple months ago, I ran across a post from Coding Horror that raised my eyebrows. Here, we had a programmer who writes and maintains his own blog but ran into a server catastrophe and scrambled like mad to piece his blog back together again.

Now that I’ve apologized, it’s time to let the healing begin. And by healing, I mean the excruciatingly painful process of reconstructing Coding Horror from internet caches and the few meager offsite backups I do have. My first order of business was to ask on SuperUser what strategies people recommend for recovering a lost website with no backup. Strategies other than berating me for my obvious mistake. Also, comments are currently disabled while the site is being reconstructed from static HTML. Oh, darn!

Remember, this was A PROGRAMMER. If this isn’t a wake up call, I don’t know what is.

Luckily backing up your Worpress isn’t such a complex task and consists of the following which I’ll go over:

  • Frequent backups of the MySQL database.
  • Frequent backups of the /wp-content folder on your server.
  • Having a copy of your entire WordPress blog.

Backing Up Your MySQL Database

There is an excellent plugin called WP-DB-Backup which generates an SQL file of your entire WordPress database that can be downloaded or, best part, emailed to you automatically at regular intervals.

Simply download, unzip and upload the wp-db-backup folder to the /wp-content/plugins directory and activate from the Plugins section in your WordPress admin. You can then configure the backup under Tools > Backup in the admin.

Note that, to get this to work, you will need to set the permissions  of the /wp-content directory to 777 (see below).

Setting file permissions using FileZilla (right click, select File Permissions)

After you download your first backup, be sure to set the file permissions of the /wp-content directory to 755.

Backing Up Your /wp-content Directory

As of this writing, I haven’t found a reliable plugin to backup the images on the posts and pages. It’s probably moot anyway since those images would add up to a large backup file over time; likely too large to have it emailed to you.

In the meantime, its best just to do regular backups of the /wp-content directory which contains your uploaded images, plugins and themes. One great way to remember to do this, at regular intervals, is to configure a schedule in the WP-DB-Backup to receive the database backups by email.

Then, immediately after receiving each of those emails, you have a reminder to download the /wp-content directory onto your computer to keep that backup updated.

Downloading You Entire Blog

It’s very important that you have a copy of your entire WordPress blog. This is especially true before upgrading your WordPress or when those unexpected moments of breakdown happen to occur.

Since WordPress files only change when upgrading this only needs to be done once, to have a current copy, then after each upgrade.

(One thing… be sure use the WP-DB-Backup to immediately download a backup file of your database before performing any upgrade.)

Due to conflicts with some plugins and themes, WordPress is known to break down and give hell after upgrading. So better to be safe than sorry.

* * *

Coming next in this series:  Speeding Up Your Blog.

More on the author, Johnny Spence
Johnny is the founder of The Freelance Rant and a freelance web programmer with 8 years in the business. Have a visit at his company Oscarrr!web or see what he's up to on Twitter.

6 Comments. Join In!