How to back-up your self-hosted WordPress blog

by Adam McLane on April 2, 2011 · 9 comments

Introduction

I’ve built and run dozens of WordPress websites. (Blogs, ecommerce sites, business homepages, etc.) As a content management system, (CMS) WordPress is famously stable. Even when there are major problems you can almost always fully recover. That said, it is a good practice to back-up your self-hosted WordPress blog occasionally. If nothing else it will keep you familiar how WordPress works. Additionally, since this procedure is the first half of moving your blog to a different host/server altogether– it’s a good practice to get into.

Level of difficulty: Medium

Time needed: 15-45 minutes

Here is a  tutorial for backing up your self-hosted blog if your host uses cPanel: (Pretty standard)

Step 1: Login to your cPanel


*Trick: Remembering your cPanel login URL is a pain in the neck. So if you can’t figure it out, just go to your primary domain and add /cpanel (Example: http://yourdomain.com/cPanel)

Step Two: Open phpMyAdmin

Tip: Most of the time when you open this it will log you in automatically. If it doesn’t, you may need to find the database login/password in the original email sent to you when you set up your hosting account or contact your hosts customer service. If you want to do this yourself, find and copy locally  a file called “wp-config.php” using an FTP client. Open that with TextEdit (Mac) or Notepad (Windows) and you will see the name of your database, the database login name, and your database password.

Here’s the link to phpMyAdmin’s website if you want to learn more.

Step 3: Select your database from left side panel. (Single click)

Tip: Refer to the file you downloaded in Step 2, wp-config.php, for the database name.

Step 4: Navigate to the export tab

Step 5: Select all tables, export as SQL


Step 6: Scroll to the bottom, double check all of the settings, press go

Step 7: Compress the file, store it somewhere safe

Windows users: You can do the same thing with WinZip.

Tip: I store these files using Dropbox. That way they are easily accessible to me anywhere I have an internet connection, and also double-backed-up, safe, and secure in the cloud.

Step 8: Create a blog back-up folder, back-up your files locally using an FTP client

Step 9: Compress the blog back-up folder and save it somewhere safe.

Local back-up vs. Server side back up

McLane Creative clients whom we offer hosting enjoy the protection of a nightly back-up. At about 2:00 AM PST each night all of the data, databases, and structures are automatically backed up and securely stored on our server. Most webhosts offer this automatically. (We recommend Hostgator if you are looking for cheap, reliable, shared hosting.)

You can rest easy that your blog is safe, in general. At the same time, especially if you are in a shared hosting environment, your site could be infected with a trojan virus that won’t be discovered for several months, your host may suddenly shut down, be sold, or otherwise become unavailable.

That’s why I recommend manually backing up your WordPress blog quarterly. If anything happens, no matter how unlikely it is, you know that you have your blog backed up. And you can only ever lose what is between your last backup and your next.

A Warning about Back-up Plugins

Aren’t there plugins that do this for you? YES! It might be tempting to skip this altogether and think that installing a plugin is all you need to do. Two things to think about which are flawed in thinking that way. First, it’s really just doing what your host is already doing. Making a back-up of your stuff and sticking in on your server. If that thing goes down, having a back-up on your server leaves you just as screwed as if you didn’t have a back-up. Second, those plugins are going to use a lot of resources– which might, just say, cause a problem with your database! Not a good idea.

Congrats! Your blog is now safer than ever. Now mark your calendar and do it again in 3 months.

  • leslie

    good article adam! how about another aticle about restoring a blog? :)

  • http://adammclane.com Adam McLane

    Great suggestion Leslie. Just to clarify, you mean restore a blog from a backup to a new/repaired server, right?

  • http://goinswriter.com Jeff Goins

    This is a bit technical for me, but I’d like to do this. What if my host doesn’t use CPanel?

  • http://adammclane.com Adam McLane

    I’d assume it is largely the same procedure for other control panel sites. (MediaTemple comes to mind.) All of the files like theme, images, plugins, and the core WordPress install can be backed up via FTP. To back up the database you may need to hunt around to see if you can find access to something like phpMyAdmin. Pretty sure I found it on Godaddy’s control panel before. I would imagine that if your control panel doesn’t have that software, it’ll have something that allows you to create, edit, repair, import, and export MySQL databases. (A requirement for a WordPress install.)

    I was thinking that I could offer this as an ala carte service. (Backups, restore, and host migrations.) I definitely wouldn’t do it for free!

  • http://goinswriter.com/ Jeff Goins

    I’d gladly pay someone to take care of this stuff for me.

  • http://adammclane.com Adam McLane

    Hmm… well, I may have some people who can make that happen for you!

  • Pingback: What to Do if Your Site Gets Hacked | Goins, Writer

  • Pingback: How do I back-up my blog? « McLane Creative

  • Leslie

    sure do! sorry for the delay :)

Previous post:

Next post: