How to back-up your WordPress blog
Having written yesterday about backing up WordPress before an upgrade, I thought today we'd have a look at what backing up WordPress actually means. It's not necessary to back up every single file of your entire install: you need to preserve the files that are unique to you. If (dog forbid) your server fell over and died, or your hosting company ceased business, or hackers wiped your site out, what would you need to put it back? The core WordPress files could be retrieved from WordPress anyway, so you don't need to waste storage space keeping copies of those. What you will need, however, are:
- a backup of your database. This includes posts, comments, categories, links, etc. etc. - all the actual content of your blog
- a backup of any images or other media you've uploaded as blog content
- a copy of your theme
- a copy of the plugins you're using
Back up wp-content
It looks like a lot, but in fact, those last three items are all in the wp-content directory. Download a copy at least once a week (more often depending on how much you blog and how important your blog is to you).
Back up your database
Before you back up, clear out spam. You also don't need to back up stats or log information (Bad Behavior's spam-block log, for one example, is a particularly huge table in some of my blogs). There are a number of ways to do back up your db:
- use WP's built-in export function from the dashboard Tools menu. This is the easiest way to back up.
- export directly from PHPMyAdmin. This allows you to be more selective about what you save.
- use a plugin like WP-DB-Backup. This can be set up automatically back up your blog at an interval of your choosing: it's much easier to back up daily if it's being done for you, rather than you having to remember to do it. The back-up file can either be saved to your server or emailed to you.
I - and it seems, some other people - have had issues with the emailed back-up for blogs with a lot of content, most likely because the file gets too large for email. It works well for smaller/newer ones.
I'm not convinced that saving a back-up to the same server the blog lives on leaves me all that secure: if the server dies, I've lost both blog and back-up. So this should be part of a "belt and braces" approach for larger blogs.
Backup your backups
It's tempting just to keep one back-up file, and keep over-writing it with newer data. But what if that file became corrupted? It's unlikely, but not totally implausible - and if your blog is important to you, you should protect against it. Received wisdom says you should keep three copies of backups, in three different places (e.g. on more than one hard drive, a file mailed to Gmail, on a CD). If you're just posting pictures of your cat, that might be overkill - but if your blog is the way you make your living - or a significant portion of your life in journal form - you need to take protecting it seriously.
With thanks to @phaude and @josordoni for the consideration of whether it's backup, back-up or back up.
Tags: PHPMyAdmin, WP-DB-Backup
Posted by Sue on June 9, 2009 in WordPress.









thanks for such kind directions.... made this intimidating task very easy!
http://sonjiabradshaw.com/post/2008/06/We-Have-A-Job-To-Do.aspx