Backing Up Your WordPress Database Safely

It can happen to anyone. You go to visit your Web site and suddenly, you notice that your content isn’t loading. Then a pit develops in your stomach as you realize that you don’t really have a proper backup of your articles, pages, and so forth.

To keep this from happening to you, allow me to point out a two step approach that will make 100% sure you’re not completely screwed should you have an event like the one above happen to you.

Exporting content

One common approach to making sure your content isn’t lost forever is the act of exporting your WordPress content. This will make an XML backup of all “text” based content such as posts, pages, categories, tags, etc. This will not make a backup of your images in the posts. While the URL record of the images are saved, the physical images are not.

To ensure your images are safe and sound, it’s best to make an FTP backup of your images folder. Try to keep the directory hierarchy intact for easy recovery later on.

Database backups

If you’re looking to do a database backup, there are multiple ways of doing so. The first and most common method is by using phpMyAdmin. It’s not all that difficult, but it is tedious and time consuming. It works well for an initial backup before implementing my next suggestion, though. I personally am a huge fan of putting things on autopilot. This means taking a hands off approach with a little something called the WP-DBManager. Create the right folder in your directory, set things to go, then have it email you a daily database and you’re off to the races! Seriously, I have never used or loved a plugin more.

Backing Up Your WordPress Database Safely
Photo by Adriano Gasparri

Database or XML backups?

It’s important to be clear on the differences between a database backup and an XML export. A database backup includes everything in an XML update, in addition to post ID numbers and other little items that might be missed by XML exports. Database backups are also going to remember theme data (settings info), amongst other WordPress settings info as well. I generally make it a point to have a daily backup of my database settings.

This being said, I like to keep my XML exports moving forward on a weekly basis. I use this as my backup of last resort. Because a blog’s most valuable asset is its content, I know beyond a shadow of a doubt that if my database backups fail me, the weekly XML export will work. I’d shoot for using both, just to be absolutely sure you’re in a good place should disaster strike.

Article Written by