ProfHacker icon

Previous

The ProfHacker Week in Review

Next

Napping Your Way Through the Semester

March 1, 2010, 10:35 AM ET

A Few Ways to Back Up Your Website

Here at ProfHacker we’ve written previously about backing up your personal computer—using Backblaze, Cloudberry, or external drives, for example—and others have discussed ways storing files for easy retrieval by multiple computers (see “Stop Emailing Files To Yourself”). But this post is about a few simple ways to ensure your website content is retrievable even when your hosting provider’s servers go belly-up (and the server with the backups does too).

These options are not all of the options for maintaining site backups, and are meant primarily for those folks who maintain basic web sites with a hosting provider. (In other words, I’m not going into things like version control software or true mirroring.)

Keep a Copy of Static Files and Images on Your Hard Drive(s)

Here, I’m using “static” to mean any files with content in them that you manually manipulate and transfer to your server via an FTP-like protocol, which may or may not include dynamic elements—for instance, the index.html file that sits in your document root may be a file that you change manually, but contains some server-side scripting elements. For the purposes of this bullet point, consider it a static file.

I know many people who simply store all their web site files on the web server itself, only downloading one when they need to make a change. This is a recipe for disaster. If your site has a set of static pages, always keep them in sync on your machines.

Say you edit files both at home and at work. On both machines, create a directory called “web site” or “world domination” or whatever you want. In that directory, hold a complete copy of your site’s files—an initial FTP session in which you select all files and directories and pull them over to your machine(s) will take care of that. Then, from that point forward, whenever you want to edit a file, first download it from the server to ensure that you have the most current copy, make your edits, and send it back up. You will always have a core set of files on at least one of your machines, and might not be too far off on another machine (depends on how often you use both machines for this type of work).

Bonus: if you have automatic backup into the cloud (I have Mozy backup my files every two days) or onto an external drive, you will have three or four backups of your static site content.

Learn to Love Your Control Panel

In my Website Hosting 101 post, I mentioned one feature you should look for in a hosting provider is the ability to manage your site via a control panel. Control panels give you an overview of your system and server status, but their primary purpose is to provide you with simple ways to complete technical tasks (usually a few clicks and the completion of a form or two). One of those tasks is likely to be a system backup.

In this screenshot, you can get a sense for the functionality my hosting provider (Daily Razor) offers via the cPanel software (click to enlarge). I can schedule system backuups or I can generate and download current backups on demand.

It is very important to note that if you use your hosting provider to generate backups on a schedule, those backups are still sitting on your hosting provider’s server (or perhaps on a drive or other server away from the live server) which does not protect you from catastrophic failures or your hosting provider closing up shop. It is important to generate backups, but even more important to retrieve those backups and store them yourself (and then perhaps in the cloud or on an external drive) for even more protection and quick access.

Backing Up Installed Programs

Perhaps your website is actually a WordPress installation, meaning it is a set of files, perhaps customized (templates and plugins), with a database backend. The simple FTP process mentioned at the beginning of this post won’t take care of your content, as your content is stored in a database. But customizations can be stored in similar ways—for instance, I have directories on my machine for each of my WordPress custom templates so that I can quickly restore or move it if necessary. The same is true for customized plugins (ones I’ve written or customized, which can’t simply be downloaded again from the WordPress plugin directory). I don’t worry about the WordPress software itself (unless I’ve customized it), as it can be downloaded again without any fuss from WordPress.org.

But what about the database that holds all the WordPress content? In my control panel’s backup tool, I can generate and download a backup of just the database, or I can go to my hosting provider’s phpMyAdmin interface and export the contents of a database manually. At this point I’ll simply defer to the WordPress database backup instructions because they take into account several different management systems.

The key point to remember here is that if your site is WordPress-driven, simply downloading the files you can see is not backing up the content of your site.

The same will hold true for other content management systems you might have installed and use: there’s the presentation layer and then there’s the data that sits behind it. You need to remember to back up both, and do not rely entirely on your hosting provider to do it. Sure, it will add a few minutes to your work week, but isn’t that few minutes a lot better than potentially losing all of your content? The Wayback Machine and Google Cache can only do so much.

[The image in this post is of a lonely stack of floppy disks, taken by Flickr user twinleaves and Creative Commons licensed. Don't back up your web site on a bunch of floppy disks. The picture is for entertainment/nostalgia only.]

Comments

1. Amanda French - March 01, 2010 at 11:02 am

A note re WordPress sites: the wonderful plugin WP-DBManager can be set to back up the database regularly on the server and e-mail you compressed (or uncompressed) files. That's what I do. And then, of course, I save the files to my hard drive -- and, like you, I've got Mozy backing up my hard drive, so I feel pretty safe.

2. Julie Meloni - March 01, 2010 at 11:08 am

I’m glad you mentioned that plugin as an option for people who use WordPress. I do not personally use that plugin for a few different reasons related to my perception of security issues, etc. But plenty of people do.

3. Mark Sample - March 01, 2010 at 04:51 pm

Lest I become the poster child of bad backup practices, I want to chime in with a few thoughts about preserving websites in case of catastrophic failure. In my own case, which I alternately mourned and mocked, I had taken what I thought were sensible precautions. I used the same WordPress plugin that Amanda mentions, only I had stopped emailing the backups to myself sometime last June. Instead I was storing them on another part of my server "in the cloud."

You see, I was prepared for something taking down my various blogs and wikis -- a WordPress upgrade gone awry, a malicious hack, or a mistake in my MySQL manipulation. But I was not prepared for my whole server disappearing.

Furthermore, as I have learned recently, neither are most consumer web hosting services. A thorough review of the fine print of a number of the most popular hosting services reveals that most of them don't regularly create backups that are available to their users. Dreamhost suggests that users "not rely" on Dreamhost's own backups. Bluehost will run backups at their "discretion" and those backups are not guaranteed. Hostgator only backs up their servers once a week, on a Sunday, and only keeps the most recent backup. In almost every case, the backup is kept in the same data center as the original itself. Meaning that if something catastrophic happens to the hosting service's data center, then you may find yourself without any backup at all. (If you want off-site backups, be prepared to spend much, much more than the $6-15/month that shared hosting services charge.)

I have never considered myself a lazy preservationist. My hard drive is backed up daily two different ways. But I was lured into thinking that the cloud was more stable, more reliable, and more backed-up. I was lucky (my service is actually one of the few that does do daily backups, and then went to extreme measures to recover even the damaged backups) and my site is fully back online after six days of downtime. But I have learned several valuable lessons:

  • Don't rely on your web hosting service's own backups. Make your own, at least several times a week. I now run a cron script that tarballs all of my databases and then emails them to me every other day.

  • I recommend using a domain name server that is independent from your hosting service. This way, if your site does go down, you can quickly point the name server to a temporary domain (that you may have as a backup). It's better to be in control of this information than to let your web hosting service do it. Had I had control over the domain name service last week (now I do), I could have put up a skeletal version of my site much more quickly, which (arguably) would have been better than no site at all.

  • And finally, relax. In the worse case scenario of total loss, remember that starting anew can be liberating and exhilarating. And nobody really cares about what you wrote on your blog three years ago anyway.

4. Julie Meloni - March 01, 2010 at 05:03 pm

Mark, as I just tweeted (but here with more characters), I certainly hope you didn't think I was calling you out as Mr. Bad Backup procedures. It was your situation that reminded me that a post of this nature is in order for everyone else, the vast majority of people who give little to no thought to having any backup procedures. In fact, the whole idea was that if something catastrophic can happen to you—someone whose technical decisions and abilities sure aren't questionable—then something bad could easily happen to someone less in touch with these issues.

I also agree that having full control of your DNS records is a good thing. I've almost always used Network Solutions for my domains (for years and years and years), but I've also used easyDNS with great success for varous projects.

5. Mark Sample - March 01, 2010 at 05:14 pm

Julie, no, I didn't think that at all about the post. More people need to realize how unreliable the "cloud" can be. I think we also need to realize that even under the best of circumstances stuff happens. In my own case, the cause of the failure was due to the actions of an independent vendor visiting the data center that manages the servers. (And the data center itself, I should mention, was not owned by my web hosting service; most of the big hosting services actually rent space in gigantic server farms housed in huge data centers.) At any point along this chain -- data center, vendors, web hosting service -- there can be a catastrophic failure. All the more reason to take as much control over your own data as possible.

6. Amanda French - March 01, 2010 at 08:59 pm

What's actually funny about this is that I just got done cleaning out my physical filing cabinet, muttering to myself, "Why, exactly, do I have all these bank statements going back to 2005?" Bam! Into the trash they went. Point being that I'm going to rely on those bloodsuckers (and their IT vendors) to keep my financial records safe in the cloud, just so I can save space.

Well, too late now. Spring cleaning of my files is officially over, but maybe I'll start saving up those bank statements as PDFs on my hard drive (love Mozy).

Add Your Comment

Commenting is closed.