WORDPRESS, WEB DESIGN, AND BLAH, BLAH, BLAH…

WordPress Wednesdays: Backup Your Database NOW!

image

Special thanks to bethany for the use of the photo.

It has been my experience that bloggers rarely think of maintaining routine back-ups until something goes awry – or in most cases, all is lost. I’ve received a number of emails in the last three months begging me to help restore what was long gone. I’ve been called I am many things, but I’m not a miracle worker.

Here’s the thing…

Servers? They crash.
They just do.
Not always, and God help us, not constantly, but it happens.

Servers are computers – and computers have a life span. If you’re with a great web hosting company, then this isn’t an issue because they administer their own 24 hour backups, but still…you are foolish to not backup your own blog.

Yes, I said foolish.
What I really meant to say was “stupid” – I’m just trying to be nice today.

Why Backup Your WordPress Blog?

Your WordPress blog stores a LOT of data:

  • First, there is the WordPress database that holds every post, comment, link, etc…you have ever keyed into the blog. If you lose this database, you lose all of the above.
  • Next, you have the WordPress Core Install (automatically installed if you use cPanel and Fantastico’s Auto-Installer), the foundation of your blog.
  • Then, there is your WordPress Theme files. If you have invested in a custom Wordpress theme, this back-up is absolutely essential. DO NOT EXPECT your web designer to maintain a copy of your custom theme. I keep my client files for about a year – sometimes longer, but it isn’t part of my service (or any designer’s service that I know of) to keep a copy of client themes into infinity and beyond.
  • Finally, there are plugin directories and files, image directories and files, scripts you or your designer have added, custom templates for static web pages, and/or post and page templates, and anything else you have uploaded.

A LOT OF STUFF!

Most of us have spent hours upon hours writing whatever it is we write. Our drivel is important to us or we wouldn’t write and publish it. So here’s a measure for whether or not you need backups: if irretrievably losing your blog would bring you to rent your garments and pour burning coals upon your head, then start doing backups; if not, and you don’t mind wearing gunnysacks…don’t.

How to Backup Your WordPress Blog Database

WordPress’ Codex has detailed instructions (imagine that) for WordPress Backups, including a helpful list of Backup Resources.

What I will blog today is how to backup your WordPress Database; because that is truly the MEAT AND POTATOES of your blog.

Got your fork? Let’s dig in.

1. First, download the .zip file of the latest version of WP-DB-Backup in the WordPress Plugin Directory.

That’s right, a pre-written, automated, “you’re gonna love it”, PLUGIN! Whoohoo! Someone else did all the work!

I like to keep original versions of all my plugins in a /plugins/ directory on my hard drive. I talk more about how I organize blog /directories/ and files on my hard drive in my It’s Wise To Organize post.

2. Once downloaded, you need to decompress/unzip/extract (geez…pick your term) the files from the zipped folder before anything can be uploaded to the server. If you are not familiar with how to do this, I have written detailed instructions (with screenshots, mind you) on how to unzip files using a PC. If you are on a Mac…

Download WP Database Backup

Download wp-db-backup.2.2.2.zip to your desktop

Open WP DB Backup with Archive Utility

Ctrl click, scroll to “Open With”, and then over to the default “Archive Utility” to extract the zipped file. You’ll notice I also have Stuffit Expander loaded on my Mac. It is a free download; give it a try if you like.

wp-db-backup Extracted

Once extracted, you will have the wp-db-backup /directory/ next to the zipped file on your desktop.

WordPress wp-db-backup File

3. Open (double click) the wp-db-backup /directory/ and scroll until you see the wp-db-backup.php file. This is the file you will upload to your theme’s /plugins/ directory via FTP. If you do not know how to FTP a file to a directory on your server, there are instructions in this post. The path to this /plugins/ directory will be:

http://www.domainname.com/wp-content/plugins/

4. Log into your WordPress Blog, scroll down the menu in the left sidebar until you find the text link for "Plugins" and click through to your blog's "Manage Plugins" page. Scroll to nearly the bottom of the page and find the subheader, "Inactive Plugins". Beneath "Inactive Plugins" you should see "WordPress Database Backup" - the plugin you want to activate.

Activate WordPress Database Backup Plugin

To the right of the plugin is a blue text-link, "Activate". Click on it and your WordPress Database Backup plugin will be activated. This will move the plugin from the "Inactive Plugins" area to the "Active Plugins" area above.

5. This plugin will try to create a /wp-content/backup-*/ directory inside your WordPress directory. You may need to TEMPORARILY set your /wp-content/ directory to 777 to allow for this. If you are unsure of how to set permissions to a file or /directory/ on the server, I demonstrated it in this post. Though that post is related to changing permissions to an .htaccess file, the same process is used in this instance with the /wp-content/ directory.

6. Now that your WordPress Database Backup plugin has been activated, you need to manage your settings for it. You'll notice in the description of the plugin it says, "On-demand backup of your WordPress database. Navigate to Tools → Backup to get started…"

Easy enough, right? Just click on the text link "Tools → Backup" to get started. If you don't see this text link, go to your left menu and scroll to Tools > Backup to get to the same place.

WordPress Database Backup Tables

The first settings are for "Tables". It is all pretty self-explanatory, but you'll note that you have an option to "Exclude Spam Comments" and "Exclude Post Revisions" on the left. It is my preference to exclude spam comments from my backups, but I do NOT want to exclude post revisions - because I make a lot of these.

I haven't checked any of the tables on the right, because some of those have been inactive a while and I'm unconcerned about them.

WordPress Database Backup Options

The next settings are for "Backup Options". This needs little clarification - it just asks you what you want WordPress to do with the backup file it creates. This is for immediate, RIGHT NOW backups. Because it coincides with the "Tables" area above. When you make those settings and click the button "Backup Now!" beneath "Backup Options" it does an immediate backup.

In other words, any time you want an IMMEDIATE backup, you can set your "Tables" and "Backup Options" for what you want and then click "Backup now!" to implement an immediate database backup.

WordPress Database Backup Plugin - Scheduled Backups

Finally, and perhaps the most lovely setting of all is "Scheduled Backup" at the very bottom of this plugin page. I have backups scheduled weekly. If I posted daily, I would probably have backups "Once Daily". All of my backups are emailed to me. I keep a backup file on my hard drive and on my external hard drive that backups each evening. This gives me two copies. I only keep the most recent copy on my hard drive, but my external hard drive backups have all of them.

To the right you'll note I have included ALL the tables, but since then I've changed it to not include any of them. I'm not using the Democracy plugin anymore (that was more for my personal blog), don't use twitter on this blog either, etc…so these aren't really relevant and I don't need them.

Once you get all the options set under "Scheduled Backup", click on the button "Schedule Backup" to begin your regular WordPress Database Backups.

Before I Close Out…

I have said it once, but it is worth saying again, that this plugin ONLY backs up your WordPress Database; not independent server files like your WordPress installation /directories/ and files, theme files, images, plugin files, etc…

Those are important too and you can either refer to the backup resources I noted above, or wait for next week's tutorial on "How to Backup WordPress Server Files & Directories". For information about how to restore a WordPress Database from a backup, backups that stop or hang up without completing, or questions regarding files within the backup /directory/ please refer to the WordPress WP-DB-Backup FAQ or the plugin's homepage.

Now, send this post to 10 of your friends before the cock crows or you may experience a re-occurrence of teenage acne, become mute, develop an allergy to dust mites (or if you already have an allergy to dust mites, genital herpes), and be forced to listen to a CD of Fran Drescher's laugh on repeat for a relentless 72 hours. Lord help you.

Y'ALL APPARENTLY HAVE THINGS TO SAY, CUZ

50 have spoken up.

That Sneaker Wearing Entrepreneurial Cartoonist Internet Guy

Yep. I actually canceled service with my old host before I realized I had not backed up my blog photo folders. Lost tons of photos. Very frustrating. Doing lots of backing up these days.

Jessica

I have a blogger blog and I’m wondering how I back that up. I know you’re a WordPress girl, but wondered if you knew of a resource. Thanks…and I’m really enjoying your blog. So fun!!

OMSH

Jessica – You’re right, I don’t deal with blogger, but I know there is something called “Blogger Backup” … I’d hit Google with that if I were you. :)

Keri

This right here is the best post I’ve read in a while. Thanks for the handy info – I followed the instructions and now have scheduled backups!

OMSH

Keri – Oh Good! Thanks for the feedback – now we just need to get you going with server file backups and you’ll be good to go!

tHeSocKmOnKeY

Another awesome resource. Thanx :)

hana

And for those of us who don’t blog…. it’s a good reminder to back up in general!

Here in the City of Angels, I still have to set up my Time Machine back up……tsk tsk

free traffic secrets

This is a great post!

If you have labored to create,get created or get a quality content only to post and come back in a few hours or days and see that its ‘just’ disappeared.

Then you’ll know why I said that this is a great post

Robynn's Ravings

Thanks for the reminder! Will Blogger hints be next?

I just went through before Blogger went down last week for an update and checked to see how many posts/articles/features I had saved to my hard drive. 75% were not there! I couldn’t believe it! In my typing/posting frenzy I had neglected to even save my work into a Word file. Amazing!(ly stupid).

I’m backed up now and ready to burn onto a CD but man. This level of stupidity might cross over into giftedness! Thanks for the good word.

OMSH

Nah, I only work with WordPress. I’m glad you’re all backed up now though!

Sarah @ BecomingSarah.com

Thanks for the reminder! I think we all know what I’ll be doing later in the evening!!! I may have only been writing BecomingSarah.com for a matter of weeks, but I still don’t want to lose anything…

nancypants

This is very good advice that I plan to take very soon! Thank you!!

Paula

Great Article OMSH. And thank you for inspiring me to learn a little more about Wordpress and to teach myself how to do more with WordPress. If I can deal with Sharepoint, I know I can do this :)

Mrs. Wilson

Heather, I love these!! I read it a couple days ago, but came back to find the link to that plugin and realized that I didn’t comment.

I LOVE WORDPRESS WEDNESDAYS!!

BeachMama

Heather, thank you so much! I have been wondering how to do this for a while. I got all the way until the 777 permissions part and cannot get any further. When I right click (or ctrl click on my Mac) I don’t get the file attributes. I do have the same box as you but, without a numeric value. Not sure if you can help me any further as you have given so much already. But, I am so much closer than I was just an hour ago. Thanks again!

Thorne

This is great info and a great start. Now I’m off to the resource links to see if I can discover how to address this error message:
WARNING: Your backup directory does NOT exist, and we cannot create it.

Using your FTP client, try to create the backup directory yourself: /misc/28/324/050/332/4/user/web/thornesworld.com/wp-content/backup-f05ea/

Yikes!

Thorne

Okay, so I’m an idjit. Reading carefully helps. Thanks for this! I’m looking forward to next week.

OMSH

Thorne – It is a lot of information to take in, but yea…#5 above addresses that. ;)

OMSH

Beachmama – You are right. On a Mac, you click on “Get Info” in your drop down menu after the ctrl click. Then, once you get that box open, you’ll find there is a File Permissions area toward the bottom of the drop down menu.

10 Tutorials I am Dying to Try | mommyknows - a mommy blog

[...] and backup my blog by installing and utilize a wordpress plugin using idiot-proof instructions from Heather (a wordpress wonder). OK … I am not really dying to try this … in fact the thought of it makes me want to [...]

Melissa

Can any wordpress them be changed and customized or this there one that is better to work with than another?

OMSH

Any WordPress theme can be changed. The way I build mine is to create a .psd file of what I want the site to look like, list all the functions I need, slice and dice it into valid XHTML and CSS, and then integrate THAT into the WordPress publishing platform.

Michelle

I must say, I really only do backups every few months. But my host never even has downtime and I’ve been with them for years, so I don’t worry too much.

Heather

You are listed on the blog list of Angie at Keep Believing. You know that she lost her husband to cancer on March 17. Angie and Brian would have celebrated their 12th wedding anniversary on April 19. I am hoping that I can get everyone in her blog list to post on their blogs at 12:00 am on April 19 a post with the title “Keep Believing” so that when she opens her blog, her blog list is filled with recent posts all titled “Keep Believing”. I don’t know how else to arrange this other than commenting on blogs, so forgive my off-topic comment. I would ask that you keep the post up for 24 hours in case she doesn’t look right away, and you don’t have to publish anything with it, just the title will do. I am using the scheduled post feature provided by blogger so I don’t forget. Thanks so much. Heather.

ern

I know it’s not quite as intricate as Wordpress if anyone wants to do a quick, basic backup of their blog on Blogger, just go to Settings:Basic and at the top there’s a button that says “Export Blog”. It will download a copy to your hard drive (it won’t delete your blog from Blogger or anything). I’m not sure if it backs up pictures though, so you may want to check that. Like I said, it’s BASIC…but I was grateful for the reminder here so I just did that to my blog. Thanks!

Su Chin

Thanks. I didn’t realise that I needed to backup my WP database. I normally just backed up my files in the servers. This was really helpful. Just completed it…within 10 minutes!

Thanks so much!

Tabitha (From Single to Married)

Thanks for the post Heather. I actually switched to Liquid Web because you recommended them and I have been so pleased with their service – they are great to deal with! And yes, I have been backing up, in fact, I have it set to do it automatically everyday. :)

jessica

even though I subscribe to your feed, sometimes I just pop over here JUST IN CASE you posted and I missed it. I’m having OMSH withdrawls.

Chris

Heather, saw you post over at PW and I was gonna ask you (on PW site) if you were going to start Word Press Wednesdays up again, but didn’t want to go off topic. Instead I took a gander over here and I’m glad I did! Imagine, a new WPW post and on a topic that keeps nagging me at 2am! I’m very excited and will be setting up my backups right away (well, maybe tomorrow…at 2am).

Stacey

When I get to the last step “Backup Options” I have a box that says “WARNING: Your backup directory is NOT writable!” Did I do something wrong?

OMSH

Stacey – Refer to #5. It explains what to do when/if that occurs. :)

bigtunelover

My gawd! I learned more in reading one article on your blog than I have in 2 weeks since starting one myself. The downside is that now I feel like a moron – thanks. I have sooooo much to learn. :) I have bookmarked you and will be back for lots of discovery. I love the whole look and feel of your website as well. Nicely done.

Thanks for being normal (in the most unique was possible) and helpful in a sea of crap.

njandjj

thank you very much i’m search arcle for this error so far

Kuky

Thank you! So much easier doing it this way then manually going in and getting my backup.

Laviyah

Done! Thanks for the advice! You are my role model.

From another homeschooling mama.

Amanda of Shamelessly Sassy

I’m following your advice pronto!

Keith Davis

Well set out post… easy to follow and answers to comments also help.
I’ll download the plugin and give it a go.

Tiffany @ Eat at Home

Thanks for the tutorial. I saw it a couple months ago, but just never made time to do it until today. It was not hard at all, even for the tech challenged, like myself. I’d love to see the next tutorial on backing up server files and directories.

Everything Acne

great post…thanks for tutorial. i learn more from it. we will come back often.

Online homeschool blogger

Hi. Here’s a really basic question which I can’t believe hasn’t yet been asked or answered.

Don’t most web hosting services include routine backups and restores of all the info?

I’ve had problems with crashes before but I’ve always just asked the hosting company for a restore and although sometimes, while it’s older than I would have liked, they have always had the goods.

Thoughts?

OMSH

Online homeschool blogger – Thanks for asking this question. SOME web hosting companies provide backups; to some “routine” is monthly and to others, “routine” is weekly. My web hosting company has 24 hour backups, but I still do my own WP backups because I am never certain when/how my blog might crash and I don’t want to be dependent on another service to make sure my goods are in place.

I also know bloggers who update multiple times/day on their blogs and could lose a considerable amount of information if there wasn’t a 24 hour backup.

This is “your” way of providing for your own backup — even if it is a “just in case the web hosting company doesn’t pull through”.

But yes, some do provide back-ups and everyone should carefully ask questions and read to find out what is truly provided when they sign on with any specific company.

Blessings!

Teri

I am so thankful fo rmy hosting company, Bluehost. I was messing with my blog the other day, I guess I was bored and I totally messed it up. I moved files where they shouldn’t be yada,yada,yada. Well… I called Bluehost and they saved me. They ran the backup and walla, there it was the way it was supposed to be.

Keith Davis

Hi Heather in this post you mention a post called “How to Backup WordPress Server Files & Directories”.

I can’t find that post! Did you ever write it?

OMSH

Keith Davis
Bwahahaha!
Um…no.
Life got in the way.
I should do that, no?

Keith Davis

I know what you mean, life can do that.
But if you do find the time… I for one would be most grateful.

Keith Davis

Hi Heather

I wrote this a few days ago on a post which was probably archived….. so I have cut and pasted below:

“Starting to get organised, starting with a copy of my site on my hard drive – database next!

I’ve just FTP’d a copy of my site onto my hard drive and notice that there are a few files, which are not part of Wordpress…

cgi-bin for instance and a couple of files, which appear to have been created when I set up the site using Fantastico (fantversion.php and fantastico_fileslist.txt).

Presumably these files would be needed if I had to reinstall? And I should keep them.”

Online

great post…thanks for tutorial. i learn more from it. we will come back after few days

Online Porno

great post…thanks for tutorial. i learn more from it. we will come back after few days

air max shoes

it is necessary to backup everything you have

Life's Been Good To Me So Far!

Very well written! I started up my blog a few months ago and had not trouble using your instructions to back it.

Thanks!
Ted

LET YOUR VOICE BE HEARD

Comment if ya wanna.