Don’t Panic! Understanding and backing up your blog

So last week I get an urgent message from blogger friend Carissa (GoodNCrazy.com) – She’d had problems with her host, and her blog was down, and she needed help getting a new host and getting her blog back up. Since I’d done her blog theme design, I was familiar with her stuff, and had a backup of her theme.  I also recommended my host, Bluehost.com – since I’ve been very happy with them*.

She had a pretty good scare that she’d lost her entire site, so I figured it would be a good idea to share how to avoid going through that kind of panic!

The advice that follows is specifically for self hosted WordPress blogs, but no matter where you host, you need to be doing regular backups!

First, understand a little about your blog… A WordPress blog is made up of multiple components:

1: Your posts.  All of this information is stored in your Database.  They are also what is exported if you do an export.

2: Your theme.  This is a directory of files on your server, under wp-content/themes  (This determines the look and feel of your site.  If you have a custom or modified theme, you’ll want to make sure you can restore it in case of emergency.

3:  Your photos or other files.  These are the files you attach to posts via the upload/insert button.  These are by default  stored under wp-content/uploads

4:  Your plugins.  Any time you install a plugin on your site, the files for it are stored under wp-content/plugins.

5:  Your settings, Users, and widgets.  Everything else that makes your blog function and look like it does is stored in the database.

6:  The actual WordPress installation (the programs that run WordPress)

So, if you totally lose your blog, and you want to seamlessly restore it to it’s former glory, you’re going to want to have a backup of all of these things (except for #6).  So how do we do this?

Backup your Files

First, set up a backup folder on your computer.  Make sure you know where you put it, so you can find it if you ever need it!  In this folder , you’re going to put everything you need to restore your site.

To get the files off your website, you’ll need an FTP program.  I use Filezilla, but it doesn’t matter which one you use.  If you use Firefox, the FireFTP plugin is another good one.  You’ll need the logon and password from your host to access the files on your site.  Your host should provide instructions on FTP access.  Get your FTP program set up, and access your site.

Find the folder where wordpress is installed.  It may be the www directory, or it may be a directory under your main directory.  The directory will have 3 subdirectories – wp-admin, wp-content, and wp-includes.

If you want to be on the safest side, you can just copy down the entire wordpress folder to your local computer.  But it’s likely that the only folder you really need is wp-content, since that contains your theme, plugins, and uploads, so copy that entire folder down to the Backup folder on your computer.  (Note, you may have additional themes you’re not using in your /wp-content/themes folder.  Those can be deleted)

Most of the things in your wp-content folder (plugins, themes) don’t change very often.  But likely you are uploading new photos all the time.  So it’s not a bad idea to copy down the wp-uploads folder (at least the new files) on a periodic basis, say once a month.  Set up a reminder in your calendar!

Backup your Data

Next we’re going to deal with the Database.  The real meat of your blog is here, and if you lose this, you’re in trouble.  But non-techies hear the phrase “database backups” and get nervous.  Although backing up the database from the phpMyAdmin tool generally provided by your host is not difficult (here’s a step by step), there are also plugins for WordPress which make it less scary, and automate the process.  Here’s the one I use: WP-DB-Backup.  You can use it to make a backup at any time (it saves a compressed SQL file to your computer.  Move that file over to your Backup directory so you know where to find it!).  You can also set it up to make weekly, monthly, or daily backups of your site, and have them emailed to you.  I like to set up this option to email to my gmail account, so I have access to it, even if I’m not at my computer.  (I don’t recommend the option that saves the file to your website.  Besides filling up website space, if you need to rebuild your site due to a failure on the hosting side, you may not have access to it!)   How often to backup?  It depends on how much you can risk losing.  For a personal blog, weekly or monthly may be fine.  But for Dabbled and Foodwhirl, I do daily backups, and just go in every so often and delete the old ones.

You now can recreate your blog if it’s lost.

Restoring your Site

Obviously, whatever happened to cause your site to be lost may impact how you have to fix it, but lets take Carissa’s example of having to move to a new host.  Her site was totally down, so we were just trying to get her back to a web presence as soon as possible.

To get her back up and running, I had to move her URL to point to the new host (in her case, that involved changing the settings at GoDaddy where her URL was registered).  That can take a while to propogate, so you may want to do this early..  If the url is not pointing to the new host, the restore can be a little trickier (you’ll have to modify the database).

I installed a new WordPress installation with a new database on her new host.  (Most good hosts have an automated method of doing this – this just took a few minutes.)  Note your new logon and password.

Make sure you can access your new wordpress install by typing your domain name.  At this point, you may want to throw up a ‘We’re having technical difficulties” message, too!  Just make a new post.  Your site will not be pretty, but at least it’s not an error message.

Next-  restore the files and data.

Files:  Use your FTP program to upload your backup theme(s), plugins, and uploads to the appropriate directories within wp-content.

Go into your wordpress admin panel and set the theme to your old theme if you like.  Your blog will look at least somewhat like home, but your posts, widgets, and so forth are still missing.

Database:

Note: If you’re not comfortable doing this yourself, you can always get someone to help you.  At least you HAVE a backup!  And you can google for more step by steps on doing this, like this one.  I’m just going to give you the basics here, so you understand what needs to happen.

  • Use phpMyAdmin to access your new database.
  • To be on the safe side, do an Export of the current database (saves a .sql file to your computer).  That way, if you mess something up, you can always restore back to this point!
  • Next, the scary part.  Select all the tables and Drop them.
  • Then, Import your backup .sql file.

Cross your fingers, and see if it worked!  Since your Users are also stored in the database–and we just overwrote the database–, your logon and password will be your OLD one, not the one you set up when you did your new install.

*I’d been recommending Bluehost so much, that I decided to sign up with them as an Affiliate, so if you need a new host, follow my link above so I get affiliate credit for it!