|
In the same way that you should always make backups of your computer’s operating system as is, plus your files; so, in the same way you should back up your WordPress blog.
Backing-up your blog doesn’t mean just keeping a copy of the files that are immediately available via your blog’s FTP server though; those aren’t the only files that you should back-up. Although those files are important, there are other files that are equally if not more important: Those files are the files in your database.
Think of your database as a simile of the Windows Registry: All the files that appear on your blog’s FTP server have corresponding entries in the database, in any one or possibly more of a number of specific tables in the database.
I won’t get too technical here; but I’ll just say that without the correct database a WordPress blog on a Linux server doesn’t work. – So you need to back-up your database as well as your files. How do you do that?
Well there are several ways of doing that; but here’s the one, possibly most unorthodox, way of doing it that I find the easiest by far.
Before I go into backing up your database I thought that I’d have a word about database optimization. – You see everything that is ever a file on your blog itself gets an entry in the database, but if you remove a file from your blog the database entry corresponding to it remains in place. For instance, say that you start writing a post on WordPress itself, and after you’ve written a page you decide that what you’ve written isn’t a good enough standard of writing for publication. You therefore decide that you’re just not in the right frame of mind to do it right now, that you’ll delete the page you saved, and come back to it and start again later on. You delete the page, but its database entry remains. When you start again there’s another database entry, which you save half-way through writing it when you have a coffee-break; and that’s another database-entry. (No; the saved page, silly, not the coffee-break. )
So as time goes by, as you can imagine, the database gets cluttered with junk, in the form of entries for saved, revised pages, etc. One page may be saved and revised many times, each creates a database entry, though the only copy you actually want is the latest revision, in most cases. – Therefore you could find that the amount of space that your database takes up on your server’s hard-drive could almost equal the amount of space taken up by the other files eventually, even though most of it is occupied by unwanted junk-entries.
Optimise first
This is where database-optimisation comes into its own. Optimizing your database means clearing out all the unwanted crap that’s making it huge, and only keeping the entries that are needed. In the old days you had to learn MySQL, install and operate phpMyAdmin, etc, to do that. These days the geeks associated with WordPress have built a plugin so that you don’t have to.
The free plugin is called WP-Optimize, not surprisingly, and it does what it says on the tin: It automatically optimises (Yes I spelled it the English way that time.) your WP database. It’s exactly like any other plugin to set up, it goes into the plugins directory inside the WP-content folder, and you activate it via the plugins section of the WordPress user interface. You’ll find the settings configurations for it in the ‘Dashboard’ section.
This plugin will optimise your database so that it doesn’t become too huge; fat with unwanted junk, causing wasted time when you back it up.
- Which brings us back up to the subject of back-up: I’ll now tell you how to back-up your database pretty much totally automatically, with very little interaction, so that there’ll be a copy of the backup of your database files retained on your server, and also you’ll have one handy on your computer too, along with the files you back-up via FTP, should the worst come to the worst.
In a while I’ll tell you what I do to accomplish this: You might like to copy me, or you might like to adapt my method to suit yourself. Whatever is the case, you’ll first have to install another plugin: -
Database back-up
This time the free plugin’s called WP-DB-backup, and it once again avoids you having to learn MySQL and phpMyAdmin by automating the backup of your database.
Install and activate it in the usual way, and set it to back-up all your database tables to your server on a daily schedule. It’ll create a folder in WP-content called ‘Backup-oc879′, if I remember correctly. Inside that folder it’ll deposit a zipped backup of your database as an .sql.gz file on a daily basis as per your settings. You’ll find the settings for this plugin in the ‘Tools’ section of WP.
I’ll mention, at this point, that when your blog starts to get big like mine is, with over 500 posts, the backups are also rather large. – You only need the latest backup (+ the one before that, for ‘luck’.) – So every week I go into that folder and erase all but the last 2 backups, which are around 12MBs in size each in my case, because I find that they take a long time to download, and if there’s less of them, considering I really only want 2 of them, then getting rid of the trash makes a lighter load.
FTP it
OK – So your database now is backed up daily to your server, and you back-up all the files on your server on a daily-basis, manually, via FTP. – That way you’ve backed up everything, including your automatically-backed-up database too. (Unfortunately you will have to install and learn phpMyAdmin if you ever need to restore your database files; but at least you’ll have a backup or more to hand should the need arise.)
I have 9 backups at a time for reference purposes on my computer.
"NINE!?"
Yes, nine: ‘kkomp latest backup #1′, ‘kkomp latest backup #2′, ‘kkomp latest backup #3′… all inside a single folder. Whenever I need to make a new backup, I find the oldest backup and delete everything inside the folder, then I back-up the entire blog including database backup(s) to the empty folder via FTP. – That way, if I do something, try it out, and then decide that it was better the way it was x-days ago, I have a back-up of just that.
Yes, it’s a little extra work, (- And you have no idea how extremely slowly and laboriously each of those backups transfers across a LAN at an average speed of somewhere around 167KB/s. It also takes over an hour to FTP them up from the server too; but I just do something else while that’s going on.) but it’s all part of the job to me. I even copy a backup to another file after renaming it by adding the word ‘old’ to its title once in a while, just for posterity’s sake.
Anyway; that’s how it’s done in my case.
Enjoy the rest of the week.
Buy “WordPress on Crack” – Build your own WordPress plugins: Click Here!
|
No comments yet.