The other day I had a friend ask me for a best practice in backing up his self-hosted WordPress blog. At some point his blog crashed and he lost just about everything. This is no good, especially when backing up and restoring WordPress has become so easy!
I follow a rule of data security that no data is secure until it lives in three different locations. For my blog that looks like this.
- Original file on my computer
- Copy on my portable external drive
- Copy on Drobo as the archive
The fail here is that at any given moment, two or three of these might be in the same place. If I’m at home with my laptop, my portable hard drive and my Drobo, and my apartment blows up, I’m done for. Your third space should be someone in the Cloud or some other safe online backup location away from your other backups.
For my blog it is much easier. I use two plugins, WP-Database and UpDraft to do daily and weekly backups of my MySQL database and the actual files behind my blog. In addition, my host provides daily, weekly and monthly backups.
Here is my backup structure.
Most hosts will only backup your website files, not your database. They leave this up to you. But with a blog, all your most important content is probably the posts which live in the database! Let’s learn how to create a fail-proof* blog backup.
Once a week, UpDraft backsup my raw data and database, sending any changes to Amazon Web Services and automatically deleting old backups. I only keep the last seven backups here. Restoring is as simple as a few clicks, as long as your site isn’t totally blown to bits from a major crash. Click to see my settings.
Amazon only charges for bandwidth not space. So if your changes are small, and even if they are big, you only pay a few pennies a month for this feature. UpDraft also stores a mirror image of these copies on my FTP server just incase AWS goes down.
Already I have my data and database in three (two unique) places (Amazon, site’s server and host). Technically you could argue that this data exists in two or four places since my host and my site server are technically only one major fail from distaster. Luckily my host uses a different server for their backups than they use for hosting.
Since I have horrible luck with things working out as planned, I use WP-Database as my backup, backup plan.
Everyday it backsup my WordPress database and stores the zipped copies in two locations. One is emailed to a Gmail account setup for this purpose alone while other copy is stored on my site server. If my host’s MySQL server crashes, I have a backup on their file server. If my host’s MySQL server and file server both fail, I have a copy in my Gmail and, if you remember, a copy on Amazon’s servers.
You might be asking why I keep the last five and seven backups. Pretty simple. If a blog crashes or is hacked and all the data is deleted, the next backup would overwrite the previous backup which means I would have no data. I have a daily and weekly schedule on two different services so I have at least one week to catch this mistake instead of just 24 hours. I also keep multiple backups back seven weeks for extra security. It might takes a few months to realize that a bug was deleting very old posts, as opposed to going to the blog and seeing my latest posts missing.
With the combination of these two plugins, you can sure that your self-hosted blog and all the related files will be safe and sound.
One more quick tip. Since I have zipped files of my database stored in directories on my blog, keeping prying eyes away is pretty important. You can easily make these files inaccessible by including an htaccess file in the directory.
<Files ~ “\.zip$”>
Deny from all
If you don’t know what an htaccess file is or how to access one, Google it. There are dozens of people that are way smarter than I am that have explanations and tutorials on the web.
But what if you use Flickr to host your photos and/or WordPress to host your blog? Fear not, there is still a backup solution for you!
First of all, everyone should have a Backupify account. It will backup up to three social media accounts at 1GB total data for free. For $5/m it will backup five accounts up to 10 GB. It does this automatically. Just set it up once and feel free to forget about it.
Now that your Flickr photos and video are backed up, let’s tackle your WordPress.com blog. Unfortunately I haven’t come across a totally automated and free way to backup your blog. But if you don’t mind two extra clicks a week, you can easily backup your WordPress.com blog by clicking to Tools in your dashboard and selecting Export. Make sure you select “All Content” and hit Download Export File.
This backup is pretty solid since it uses WordPress’s WXR format but it does not contain any of the files behind your blog, just the posts, pages, comments, custom fields, categorie and tags. A shortfall of hosting on WordPress.com, luckily their servers are solid. I haven’t heard of anyone permanently losing data. Still, if this is a worry of yours, self-hosting a WordPress blog has never been easier or cheaper.
Another great backup plugin for a self-hosted WordPress blog is WordPress Backup to Dropbox. The name says it all as this plugin will backup your site’s files and a SQL dump of its database and send it to your Dropbox and can be set for full automation. Personally I do not use this since it relies on Dropbox’s questionable ability to protect your files and does not encrypt the data. Within its backup are the usernames and passwords for your WordPress installation. If it would encrypt the backup zip files, I might give it a go.
- 9 Dropbox Plugins for WordPress
- The Secret for Making Proper WordPress Backups
- How to Schedule Database Backup Using Cron Job
- Backup4all Professional Is a Robust Personal Backup Solution