A Friendly Reminder: Back Up Your Blog

Filed as Features on November 29, 2007 8:00 am

Last week, I had a major freak-out when my blog suddenly became inaccessible. There was nothing wrong with its WordPress install, but the MySql database behind the scenes was stuck – I couldn’t access it via phpMyAdmin or SSH – breaking my blog completely and leaving me helpless.

While this was happening, I kicked myself for not backing up in the past few months, and sadly wondered if I would have to create a new database and recreate posts from scratch.

I eventually contacted my host (I don’t know what they did) and they got things working again – now all is well.

But my panic was a wake up call – a reminder that it’s important to back up your blog’s database – where all the posts you write actually reside. The files within your WordPress directory contain the code that serves up the pages, the themes, and plug-ins. But the heart of the blog – the actual content made up of hundreds of posts – is stored in a MySQL database that lives only on your server.


Backing up this databasemeans getting a “MySQL Dump” of your blog to your local computer. Here are instructions for blogs hosted on WordPress.com, using a database manager like phpMyAdmin.

If things get really dire, you may need to initiate the MySQL backup through a command line, or SSH. You’ll need to know the name of your database, the login and password of the MySql database containing your blog. These are located in the wp-config.php file in your WordPress directory. Instructions can be found at the WordPress Codex.

Either method will give you a file named databasename.sql.gz – which literally contains all the content of your blog in compressed form, plus the MySQL commands necessary to recreate the database if need be. You can upload this file into an empty MySql database, essentially restoring your blog.

You can also install WordPress plug-ins to make back ups easier, or even automatic:

WordPress Database Backup: Il Filosofo

Upstart Blogger has a good summary of the steps involved.

Yes, some of this technical information made my eyes glaze over, too. But just imagine the horror of your entire blog vanishing into thin air as some subtle motivation.

In the absence of a database back up, Google might help to recreate some old posts. You do a search for site:(your blog url) and then click on the “Cached” links to see what exists in the Google cache. You could also dig through your RSS feeds. But obviously, recreating an entire blog using either method would be a time consuming and tedious chore.

Backing up your blog through a MySQL dump takes advantage of functionality that’s built into your web server. So back up your blog today!

Tags:

This post was written by

You can visit the for a short bio, more posts, and other information about the author.

Submissions & Subscriptions

Submit the post to Reddit, StumbleUpon, Digg or Del.icio.us.

Did you like it? Then subscribe to our RSS feed!



  1. By Alex posted on November 29, 2007 at 9:20 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I would recommend each and every owner of a website set up a ‘cron job’ to backup and email/FTP/SSH the results of the backup daily. Any half decent host should have the option in their control panel. You never know when things go wrong, and they invariably do at the worse time.

    Reply

  2. By KK aka Tina posted on November 29, 2007 at 9:32 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I discovered phpMyAdmin can’t handle to import more than 2MB of data with my host. So if you have a larger database, you have to find out how much can your phpMyAdmin handle.

    It’s also good to simulate a recovery phase so that if in case of a real incident, you know how to recover fast and it’ll be less stressful.

    Reply

  3. By Gyutae Park posted on November 29, 2007 at 11:30 am
    Want an avatar? Get a gravatar! • You can link to this comment

    As a blogger, your brand and your content is probably your biggest asset. It amazes me how people take that so lightly and fail to backup their databases. Plugins make the process so much easier so there’s really no excuse for not backing up. Don’t be lazy.

    Reply

  4. BusinessBlogWireNovember 29, 2007 at 2:10 pm
  5. By Chris posted on November 29, 2007 at 8:52 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Blog is successfully backed up. Thanks for the reminder.

    Reply

  6. By Michael posted on November 30, 2007 at 6:55 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I use WordPress Database backup to automatically email me a backup of my database weekly, if I lose one week of posts, it isn’t that terrible.

    (when I get the email I backup all of the files on my server so that I have a full and fresh backup every week)

    Reply

  7. By pelf posted on November 30, 2007 at 11:50 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I schedule automatic daily backups and have them sent to my email every night (whether or nor I published any new posts in the last 24 hours).

    I know it sounds crazy, but I’ve lost my blog before so I want to ensure that that never happen to me again :D

    Reply

  8. Bountiful Buffet of Bookmarks :: JMorris OnlineDecember 12, 2007 at 12:53 am
  9. Protecting Your Data When Web 2.0 Sites Fail » Webomatica - Technology and Entertainment DigestJanuary 5, 2008 at 8:11 pm

    Your words are your own, so be nice and helpful if you can. If this is the first time you're posting a comment, it might go into moderation. Don't worry, it's not lost, so there's no need to repost it! We accept clean XHTML in comments, but don't overdo it please.

    Current ye@r *