A Friendly Reminder: Back Up Your Blog

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

See Also
Apple Silicon Processor

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!

View Comments (9)
  • 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.

  • 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.

  • 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.

  • 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)

  • 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

Scroll To Top