
If there’s one lesson I’ve learnt from years of building websites, managing Linux servers, and teaching students, it’s this. Nobody thinks backups are exciting until they desperately need one.
I’ve lost count of the number of times a student has confidently said, “It’ll be fine, I only changed one file.” Five minutes later they’re asking whether I know how to recover deleted code. Unfortunately, computers have an incredible talent for proving us wrong at the worst possible moment. Whether it’s a failed update, a broken plugin, accidental deletion, or even a hacked website, things can and do go wrong. The good news is that most of these disasters are recoverable, provided you’ve prepared for them.
A backup is simply a copy of everything your website needs to function. That includes your website files, databases, uploaded images, configuration files, and in some cases even parts of your server configuration. I usually compare it to saving a game before fighting a difficult boss. You hope you won’t need that save, but you’ll certainly appreciate having it if everything falls apart.
One mistake I see surprisingly often is people believing they’re protected because they have a backup folder sitting on the same server as the website. Unfortunately, that’s only helpful until the server itself fails. If the hard drive dies, the hosting account is deleted, or an attacker wipes the machine, you’ve potentially lost both the website and the backup in one go. That’s why I always recommend keeping copies somewhere else, whether that’s cloud storage, another server, a NAS, or even an external drive. It doesn’t matter where the backup lives, as long as it doesn’t rely on the same hardware as your website.
One piece of advice I’ll happily repeat until I’m blue in the face is this. Never, ever, EVER trust a single backup, whether it’s provided by your hosting company or one you’ve made yourself. That doesn’t mean your host is unreliable or your backup software is broken. It simply means backups can fail. Files become corrupted, backup jobs stop running without anyone noticing, accounts get suspended, and sometimes the backup you were relying on turns out to be incomplete. I’ve seen every one of those happen over the years. The safest approach is to have multiple backups stored in different places and, just as importantly, to test them occasionally. If you only have one backup, you don’t really have a backup.
Of course, backups are only useful if they actually work. One of my favourite questions to ask students is whether they’ve ever restored one of their backups. The answer is usually silence. Creating backup files is easy. Knowing you can restore them successfully is what really matters. A backup that has never been tested is based on hope rather than evidence. Spend ten minutes restoring your website to a test environment now and then. You’ll sleep much better knowing the backup actually works.
But let’s say you’re reading this because the worst has already happened and your website has disappeared. The first thing to do is avoid making the situation worse. Don’t immediately start reinstalling everything or uploading random files. Instead, stop and work out what actually happened. Was the hosting account deleted? Did an update fail? Has the website been hacked? Did someone accidentally remove files? Understanding the cause will make recovery much easier and may stop the same thing happening again.
Once you’ve identified the problem, start looking for anything that can help you recover. Contact your hosting provider first, as many automatically keep daily or weekly backups even if you never enabled them yourself. Check whether your control panel has snapshot or backup tools available. Search your own computer for old copies of the website, SQL database exports, ZIP archives, or deployment folders. If you use Git, check your repository, as your source code may already be safely stored there. Cloud storage services, external drives, and even old laptops can sometimes contain the files you need. If all else fails, websites such as the Internet Archive’s Wayback Machine may have captured pages that can help you rebuild at least some of your content. It won’t restore everything, but it’s often far better than starting with a completely blank slate.
The final lesson is one I hope nobody has to learn the hard way. Every experienced developer has broken something at some point. I’ve done it, my students have done it, and every systems administrator I know has their own horror story. The difference isn’t whether mistakes happen. It’s whether you’re prepared when they do. A solid backup strategy, multiple copies stored in different places, and the confidence that you’ve actually tested them can turn what would have been a complete disaster into nothing more than a slightly stressful afternoon.

Join the Discussion
What's been your biggest "I really should have made a backup first" moment?