Backup Strategies for WordPress

For even the smallest WordPress site, not having an effective backup strategy in place can mean a small issue with your website resulting in a prolonged period of downtime, losing your place in search engine rankings and many hours of valuable time being taken up trying to piece a site back together. If your website is a shop and/or includes significant amounts of user data, then the loss can be catastrophic and something that can sink your business. Fortunately, there are plenty of tools out there that can help, and with a small investment of time, you can be prepared for the worst.

It’s sometimes said in IT that you haven’t backed up properly unless your data is in at least three places, and used at least two separate backup methods. This is something we definitely agree with and encourage. If one set of backups are somehow inaccessible, then having a second set taken using an alternative mechanism increases the probability of recovery significantly.

The first step is to document your website. Make sure you have at least the following in a document, printed out and filed where it can be found in case of a disaster. Usually we don’t advocate writing down passwords, but this is an exception to the rule, you should password-protect your electronic copy though.

  • DNS registrar details and control panel login
  • IP address of your site and host control panel login details
  • Emergency contact details for your host
  • Your WordPress database connection details
  • Your WordPress dashboard login
  • Details of your theme and plugins
  • Details of any third party services you use and logins, such as MailChimp, PayPal etc.
  • Details of passwords for backups.

The next step is to make sure that your website is being backed up. We usually go with a two-pronged approach. The first is to have the host back-up the server and database. The usual pattern is to take a full backup each week (often on a Saturday or Sunday night), then an incremental backup each night that picks up changes. Keeping backups for the previous 4 weeks is usually a good trade-off between not taking up too much space and being able to go back a reasonable distance in time in case you find that a problem has existed for a while.

It goes without saying that you should check on a regular basis that your backups are running correctly (setting up email alerts is ideal) and that the files can be accessed. Unfortunately it can sometimes be difficult to do a test restore as it will result in your website being overwritten, but it’s generally a good idea to try out a backup and restore just before you send your website live. One thing to be wary of is that databases get backed up properly. Just backing up files is often not enough and in order to be able to restore your database you’ll need to have run a database-specific backup routine in place to dump the data. If you do this, make sure you keep a note of where it gets saved, and the steps you’ll need to perform to restore it.

The second prong of our approach is to use BackupBuddy. This is a brilliant plugin for WordPress which is a true “Swiss Army Knife” of backup. Our preferred strategy is to take a weekly full backup of the website, then nightly backups of the database, with a 4 week retention period. It’s usually enough unless you are continually loading files onto the site, in which case you’ll want to do a full backup more often.

One of the nice features of BackupBuddy is that it will send your backups to a number of different locations, including FTP, Dropbox, AWS and their own proprietary “Stash”. My preferred location is to leave the files on the web server and to send them to Dropbox as I have something like a TB of storage that I’m not otherwise using and it’s easy for me to get at the files from just about anywhere should I need to. One tip is to set the backup folders not to synchronise with your local machine to save bandwidth and your disk space. As with server backups, it can be handy to set BackupBuddy to remind you by email when it has run, and you should check from time to time that files are being saved to the right place.

The other nice thing about BackupBuddy is the ease of which you can restore files not just to your web server, but an alternative location, for example, if you want to check the contents of a backup on a test domain, or if you want to move your site to a new host. All you need is the zip of your backup (either the full or database-only version) and a  file called importbuddy.php. Upload both to the root of your website using FTP, then run importbuddy.php in a web browser and follow the simple on-screen instructions.

The other nice thing about the importbuddy process is that it will update your wp-config.php file and database should you change the domain or database server details. As such, it’s also a really useful tool during development, for example, when you want to move a site from a development to production server (or visa versa), but that’s something for another day.