Backups

Tuesday, February 9th, 2010

We live in a world now where everyone has data that is important and they don’t want to lose but, where all this data is on devices that aren’t perfect. Hard drives fail, pen drives are lost, discs get scratched and (for anyone still living 15 years ago) floppy drives get put on a box of magnets.

The point is, backup is very important, but it is something that no one really considers worth doing until after they need it, by then, it is too late. There are plenty of ways to back up all kinds of data now. Most of it depends on what kind of data it is, and where it is saved.

It is important to remember, it is not a backup if it is the only copy. This might seem obvious but I have seen people who have burned their photo collection to a DVD and then think the data is backed up so they delete the files from their computer. Then after 6 months of using the DVD as a coaster on their desk they want to show someone their holiday pictures and find the DVD doesn’t work anymore. They are then confused because it is a backup.

I’m a little paranoid when it comes to back ups. I don’t want to lose anything so I have at least 2 copies of irreplaceable data that I would be upset if I lost, and several copies of incredibly important data where I would be screwed completely if I lost it (such as my university work, data loss isn’t an excuse for a late assignment). The problem with all this is that I am really lazy. I don’t want to have to remember to back up everything all the time, I just want it to run automatically.

Windows Home Server helps with this a lot, it can automatically backup the computers on your network everyday. It will turn it on at 2 am and backup the entire hard drive. This doesn’t take long since it only does an incremental backup. Some of the important data I keep on the server such as my photos are saved in a share with folder duplication enabled. This makes sure that everything in that shared folder is stored on 2 hard drives so if one fails, the data isn’t lost. Obviously this needs twice as much space so I can’t have it for everything.

I’m a little more paranoid than that though. I have a program running on the server that will download a complete backup of this website every night over FTP, and I have a plugin installed that emails me a database backup every night. The programs I use for this are FullSync and the plugin WP-DB-Backup. I realise that my hosting company probably keeps backups, but I don’t want to have to rely on it only to find that they only do it once a month.  I don’t think that it is a good idea to rely on someone else to back up your data.

To stop my inbox getting filled with backups I use a useful Gmail feature, you can have + and then anything you want after the username and it will still arrive in your inbox, e.g. username+backups@gmail.com. This then lets you set a filter on incoming email to that address. I have these are automatically marked as read, achieved to skip the inbox, and labeled as backups. This stops them being in the way of my normal email but I still have them.

However, I don’t trust Gmail. A couple of years ago I logged in to find that every email was gone. Gmail never responded to my support request and I still don’t know what happened. That is why I backup my emails as well now. I have a program call Gmail Backup that I run on a scheduled task every day to download all my emails into a zip file. It is possible to run from command line so I wrote a batch script to do it and have that run daily on a scheduled task. This is on my Windows Home Server as well so everything gets downloaded into my backups folder that has folder duplication on.

I also use Dropbox. This is more for convenience of synchronizing my work between my PC and laptop but it doubles up as an extra backup. You can set a folder as being your Dropbox folder. Everything in the folder is automatically synchronized to their servers. If you install it on multiple computers then it will automatically download changes as well so it can keep several computers synchronized. You get 2GB of space on a free account.

I recently started using Subversion for all my version controlling of code. I didn’t use anything before. The SVN server is running on my Windows Home Server and the repositories are in a share with folder duplication. For an extra level of backup, there is the latest revision of everything in the share as well. ‘svn update’ executes every night on a scheduled task. I never change the code in that folder so there should never be any problems with merging.

Finally, and again more of a convenience than a backup, I keep a copy of most important things on my pen drive just so I have them when I’m not on my computer. I have a portable version of Dropbox installed on it and the latest revision of my SVN repository so that is another backup as well.

I don’t expect most people are as thorough as me about backup but I think that everyone should have a system in place, an automatic one is even better because you can just set up and forget.

It is important to make sure that your backups are in a format that is easily restorable. Before I stared using WP-DB-Backup I was running a script I had written myself to back up to the database. It worked perfectly except the backup didn’t contain any SQL to create tables so it wouldn’t have been very easy to restore. There was also no compression on the file so they were starting to get quite big. I ran it on a cron on my hosting and it was starting to fill up my web space.

http://www.gmail-backup.com/

Tags: , , ,