Scroll to content

Let’s talk about backups.

There are two kinds of people: those who have lost data, and those who will. I’m one of those who have lost data, so I’m going to take a moment to tell you how I go about avoiding that.

What’s brought this on, you might ask? Blame Mike. We were just talking about data loss and backups, so I thought I’d turn my pain into a teachable moment. I’m nice like that. Once upon a time I rented a managed VPS from a provider. I ran this site on it, my billing and project management software, my email server, everything. I also rented backup space from the same provider. It was mounted to the filesystem of the VPS, and I ran scheduled backups to it. I thought I was covered – it was backed up, right? I’m not sure exactly what went wrong, but my VPS went down and so did the backups. Maybe they lost a whole rack to some bizarre freak accident. I don’t know and they didn’t want to tell me.

It could have been a lot worse. At the time I was dead set against providing hosting to clients, because I’d just be a middleman between them and the folks who were actually doing the work and had out of hours support staff and such, so all I lost was my own data. I’m not going to name and shame the provider, that’s not the point of this post. The point is that a backup hosted by the same provider as your website is putting all your eggs in one basket. A widespread issue at that provider can quite easily take out your webserver and backups in one fell swoop, as I found out.

These days I take a very different approach. This site is hosted on a VPS that I manage myself. It lives in a datacentre in Maidstone. Every night it performs a full backup to a directory on its own filesystem. My main NAS running in my rack here at home connects to it over SSH and downloads all the backups. This NAS is itself backed up via immutable snapshots to my backup NAS, so at any given time there are 3 copies of the data on this server on 3 separate machines in 2 distinct physical locations over 170 miles apart.

Make sure you have backups. Make sure they’re automated, because if your procedure is manual you will forget to or be unable to do it at some point. Make sure you have more than one backup, because two copies are one and one is none. Make sure you don’t have the only copies of your data in the same building. And finally make sure you regularly test restoring from those backups, because the worst time to discover that you can’t is when you desperately need to. Here endeth the lesson.

This entry was posted in Homelab and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)