Everyone who has ever lost any data knows the importance and value of a good backup strategy. And it doesn’t only go for WordPress, but for all kinds of data you keep on your computer. However, the matter becomes really essential for every WordPress developer’s existence.
Apart from the need of backing up your own data you also have to provide a way for your clients to back up their blogs’ content. If nothing else, a good night’s sleep should be a valid enough reason to take care of this.
If you do not provide such a possibility then, inevitably, one day someone will call you and say that they have just lost their site and now they expect YOU to bring it back. If you’re dealing with not that technologically savvy client then they won’t understand why the data has been lost forever, and then … good bye Mr. Client.
Fortunately, getting this done is not so complicated and a good backup strategy for WordPress has only a handful of elements, so let’s take it from the top.
Performing the initial full backup
This is often the most crucial part. Once you have the site developed you have to create a complete copy of everything that’s a part of the site, and then store it somewhere in your archives. Things that need to be included are: the whole blog’s filesystem, and the database.
This initial backup is best done by hand, in my opinion you shouldn’t be relying on any plugins to do this part of the job for you. Most often this is the most important backup you make as it represents the first “production” (working) release of the website. After you have this done you can begin setting up the rest of your backup strategy.
What to back up on a schedule
For most blogs there are just two things that need to fall into a weekly or daily backup schedule:
• the database
• the uploads folder
Why only these two? In most cases your clients won’t be playing around with the source files of their WordPress installation or the theme’s installation, so the backups don’t need to take that into account.
And even if your clients show a tendency to have a look at the code I’m not sure if you should back that up anyway. It may cause a situation when all of the recent backups contain files that are corrupted or simply have some pieces of unsafe code in them.
In the end, if your backup strategy includes frequent backups of the database and the uploads folder, and you have your initial full backup then you will be able to bring the blog back to life after a crash 100% of the time (yes, I said it).
How frequently should you back up
There are two sides to this issue. The first side concerns on the size of the blog. The bigger and more popular the blog is the more often backups should be made. The scope is very wide here. For instance, if I owned a brand new blog I would back it up every other week. But if I owned ProBlogger I would back it up every hour.
It’s really up to you to decide on the best time span between the backups. But whatever you choose remember about the other side of this issue. Manual backups should always be made before and immediately after any updates to the source files of the blog.
The “before” update protects you against nasty crashes after the updates, and the “after” backup stores the newest working state of the site.
Now what do I mean by updates. Two things: (1) performing standard WordPress updates via the “Updates” section in the WP admin panel, and (2) doing some manual adjustments to the source files of the theme, plugins, or even the WordPress core files.
This sort of manual backups are very similar to the initial full backup, as essentially every file needs to be backed up to preserve the working state of the site. However, I advise to use a little help here and install one of the available backup plugins (more on those in a minute) to speed this up a little.
How to back up
You can approach this in two ways:
1. Backing up by hand
This is the safest and the most confident approach, yet the most time consuming at the same time. First, you need to back up the filesystem. The traditional approach here is to simply use FTP and download all files to your computer, so no surprise here. Then you can store the backup on Dropbox or Amazon S3 if you prefer to.
Backing up the database can be done in many different ways. You can start by looking at the features your hosting provider offers.
For instance, cPanel – one of the most popular hosting platforms – offers a quick way of backing up both the database and the filesystem of your blog. Just go to “Backups” and then use “Download a Home Directory Backup,” or/and “Download a MySQL Database Backup.”
Additionally, nowadays every hosting platform using MySQL also provides the PHPMyAdmin platform for managing the database. Not surprisingly, the platform gives some backup features as well. You can simply go to the “Export” tab to see what’s available.
Remember that this is a database management platform, so you have complete freedom over what tables you want to backup. Actually you have complete freedom over whatever else you want to do there, so be careful. For that reason downloading a database backup via cPanel is a much safer approach.
There’s one more way of creating a database backup, and it’s the built-in export feature in WordPress. However, it doesn’t update the database per se.
It creates an image of the database and transforms it into an XML file. The outcome of this is that you can’t restore your database with it directly, only via the import feature in WordPress. For that reason it’s not my favorite backup method.
2. Backing up automatically
Not surprisingly, nowadays, there are many automated WordPress backup solutions. If you’re willing to spend some money you can get a really quality and safe service.
For complete backup platforms you might want to take a look at BackupBuddy (from $75 a year – 2 sites, to $150 a year – unlimited sites), VaultPress (from $15 to $350 a month per site), “WordPress Smart Backup” ($20), myRepono WordPress Backup (storage and transfer dependant pricing).
There are also some free and semi-free (depending on your usage) plugins. So if you don’t want to spend a dime I recommend “Online Backup for WordPress” by Backup Technology.
This plugin provides features such as: backing up both the database and the filesystem, scheduling, encryption(!), event log, the possibility to download backups immediately or to have them sent to an email address, and integration with backup storage at Backup Technology.
From what I can see the online storage is free of charge up to 100MB. But I’m not recommending this plugin because of this storage, I’m recommending it because of its possibilities to create a backup schedule and then have every backup sent to an email address (or made downloadable). It’s very very handy.
One of the more popular plugins offering S3 integration is the “Automatic WordPress Backup” plugin. The plugin is free, but, of course, you still have to pay for the S3 subscription. The more you store on S3 the cheaper it gets. The starting price (the expensive plan) is $0.140 per GB for the first 1TB per month.
For Dropbox, consider using the WordPress Backup to Dropbox plugin. The plugin is free (accepting donations via PayPal), and if you’re using less than 2GB of space then Dropbox is free as well.
In the end, it’s for you to decide what solution you want to go for. But whatever you choose you have to trust it. Otherwise, you won’t be motivated enough to use it regularly.
Backing up your backups
This is the final point to this post, and something a lot of people tend to forget about. There’s no point in backing up anything if you lose the backup as well.
This is somewhat covered if you’re using external services like Amazon S3 or Dropbox, or any other service mentioned in this post, but if you’re keeping the backups on your hard drive then it’s a good idea to take care of some additional backups.
Some of the most common ways to get it done is to:
• Store backups on pen-drives.
• Burn CDs and DVDs.
• Store backups on different hard drives.
• Keep additional copies on your computer at work/home (in a different geographical location).
I hope I have the topic covered. Now it’s your turn to share your opinions, experiences and own approaches at backing up WordPress. What’s your strategy step by step? Feel free to share.
About the author:
Karol K. (@carlosinho) is a 20-something year old web 2.0 entrepreneur from Poland, and a grad student at the Silesian University of Technology. He shares his thoughts at newInternetOrder.com. Tune in to get his blogging advice.