Sciencetext Tips & Tricks

Blogging tips, browsing tricks and computing hacks

Verify Your Blog Backups

October 6th, 2008 · by David Bradley

Wordpress logoIf you’re a diligent webmaster you keep backups of your databases, blogs posts, graphics, right? It is a crucial part of running a modern website or blog because there is always the risk of a server failure or your site being hacked. Most of us no longer edit and keep copies of static html pages on our PC, relying on MySQL or something similar for the storage of data used to create the site on the fly.

For Wordpress users with their own hosting, backing up is a relatively painless business, particularly if you use the wp-backup plugin. It’s definitely advisable if you are preparing to upgrade to the latest version of the blogging software. But, once you’ve downloaded the backup how can you tell whether it is valid or not? One of the steps described in the upgrade process or Wordpress specifically says: “Verify the backups“. But how?

One way to verify a MySQL backup would be to simply unzip (using 7zip, Winzip, WinRar, depending on the compression format used during backup) and open the file in a text editor (free Notepad++ for instance), work your way through and check that it all looks okay. But, I’m no expert in scanning unzipped databases so that really doesn’t help me. The size of the file might provide you with a clue. If your MySQL admin reports that the database is a certain number of megabytes and the download unzipped is an order of magnitude different, then you can be pretty sure the backup did not work.

The only sure-fire way to verify a blog database backup is to use the “restore” command, if it works properly, then the database backup is okay. If it doesn’t work, then you just trashed your blog. It’s an invasive approach to testing. A non-invasive alternative is to create a new empty database and restore into that, if all the posts etc are okay in this secondary version of the site, then your backup is okay. But, you have to remember to delete that secondary version once you’ve verified it.

Denis Balencourt also recommends, if you have access to database tools, Zmanda (aka ZRM) for MySQL or failing that he confirms my suspicions that a standalone installation of your blog on your machine is the way forward for testing.

Alternatively, you could create a standalone MySQL server on your Windows PC, Linux machine, or Mac using XAMPP from Apache Friends. This allows you to set up a standalone Wordpress installation on your machine. Restore the daatabase into this standalone version and you can then verify that everything is okay. Such a standalone offline version of your blog will also let you test other aspects of the site, such as new themes, without messing with the actual site until you are ready to update.

I tried XAMPP but kept getting config errors (my fault), luckily Denis recommended WAMP and I found a straightforward (if long) method that uses that tool for installing Wordpress on your Windows computer. The installation went fine and I am not just importing the backed up database…

3 responses so far ↓

  • Ari Herzog // Oct 8, 2008 at 6:20 am

    Thanks for reminding me, David, that I never backed up my blog - which is hosted by Blogger.

    Browsing around, I came across a net utility that runs on the Microsoft NET engine: http://www.codeplex.com/bloggerbackup

    It lasted under five minutes to download 510 posts and comments into a single XML file that now resides on my computer.

  • Kim Woodbridge // Oct 10, 2008 at 11:56 am

    I’m always reminding my readers to backup.

    I loved this part - lol

    “The only sure-fire way to verify a blog database backup is to use the “restore” command, if it works properly, then the database backup is okay. If it doesn’t work, then you just trashed your blog.”

    I’m glad you then recommended restoring into an empty database. I’ve discovered recently though that a lot of people have 1 database with their hosting plan - I can’t imagine.

    And glad to read your mention of Notepad++ I love that text editor and use if for just about everything except my resume.

  • David Bradley // Oct 10, 2008 at 2:25 pm

    Yep, I do try to inject some humor into otherwise serious topics ;-)

Leave a Comment

Comments are checked for spam before appearing, no need to post it twice.

Related Posts