Get Ready for WordPress 3: Backup Your Database

Now that WordPress 3.0 RC3 (third release candidate) is out, it can only mean that WordPress 3.0 is just around the corner. The final version could be any day now, so now is the time to start getting ready. Thinking about doing the update to 3? Awesome. It should be painless for you, but … this doesn’t mean that you shouldn’t plan ahead. You need to back up your WordPress database.

First.

If you don’t have your WP database backed up on a regular basis, now is the time to start. The easiest thing to do is to install WP-DBManager. Doesn’t matter if you install it through WordPress or manually, the key is to install it and activate it.

Once WP-DBManger is active, look for the new “Database” button and click the options link. (Yes, I know there is a big red box at the top of the screen saying your database backups might be at risk; we’ll get to that in a moment.)

Most of the time the settings at the top are going to be just fine, so what you’ll want to do is scroll down and set how often to back up and how often to optimize.

I have my database set to backup every day, but I left the email box blank so I’m not emailed a copy. If you want extra security, have a copy sent to your gmail account. Remember after a while you’ll want to clean things up and delete old copies of your database.

I have my database set to optimize every 7 days, I think the default is 3 which seems extreme to me.

Click Save Changes, then click “Backup DB”.

Now you’ll make a backup of your database, just to have an extra bonus one (or if you want to update WordPress right then). On the screen, just click “Backup” and wait until its done. I like to gzip (compress) my database because uncompressed it’s about 40 megs.

Now for the error.

There is a file called htaccess.txt in the plugin’s folder (wp-content/plugins/wp-dbmanager) and you just have to copy it to  wp-content/backup-db/ then rename it to .htaccess. You can do this a couple of ways via FTP. First is if your FTP client is like mine (Transmit from Panic) you can drag htaccess.txt to the right place then rename it. If your FTP client can’t do that, then download a copy of the plugin from WordPress.org (the link is above), unzip it, then upload htaccess.txt  from your computer to the right place on the server.

Don’t forget, you have to rename the file to .htaccess for the error to go away (and the protection to actually work). For most FTP clients, you can easily do this by right-clicking (command-click on the Mac of course) and from the contextual menu selecting “Rename”.

You might wonder about the rest of the important stuff in wp-content (themes, uploads, etc), well if you’re like me that’s getting to be a pretty hefty download. I have yet to find a reliable way for those files to get backed up, beyond what DreamHost does automatically. If someone has a simple and easy way to backup your wp-content directory, I’m all ear.

Yes, I do SSH up to the server, zip a copy, and download it. However, not every one can SSH up to there server to download the files. And the web-based file managers sometimes have issues compressing large numbers of file.

So when WP 3.0 drop (any time now!), remember have your database backed up first. Then go ahead and update.

Comments

  1. says

    Great reminder Tris! Too often I’ve ‘lived on the edge’ doing an update without a recent backup. Currently I use WP-DB-BACKUP — which seems to have fewer features than WP-DBMANAGER, but works fine for my needs.

    One thing I did notice, after the DB size grew past 25MB, emailing to Gmail didn’t work, as that’s the max attachment size for Gmail. So now I manually FTP a copy of the backup to a local machine.

    Can’t wait for WP 3 — and yes, am backing up prior to updating it!

  2. says

    Great reminder Tris! Too often I’ve ‘lived on the edge’ doing an update without a recent backup. Currently I use WP-DB-BACKUP — which seems to have fewer features than WP-DBMANAGER, but works fine for my needs.

    One thing I did notice, after the DB size grew past 25MB, emailing to Gmail didn’t work, as that’s the max attachment size for Gmail. So now I manually FTP a copy of the backup to a local machine.

    Can’t wait for WP 3 — and yes, am backing up prior to updating it!

  3. Jaki Levy says

    These are great WordPress resources – I
    actually just started digging into a really really solid book on WordPress 3.0.
    It’s got some really nice code samples, and is written by a few pro WordPress
    developers (including some from Envato). I’m actually giving away 2 copies of
    the e-book on my site – check out the details about the e-book and the giveaway
    here – I think you’ll dig it :
    http://bit.ly/lq20Ff

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>