I got away with it

I was working on an update to the Monument to Stupidity, adding a moderation system to stem the slow ebb of spam, and time came to update the deployed system.

I'd set the server up wrong so was having trouble with folder permissions, and a few cheeky chowns weren't doing the trick, so I deleted the repository and recloned it. I performed the necessary setup steps, started the server, loaded up the site and had a heart attack.

The website was empty.

The monument runs on SQLite, which essentially means the entire database is a file that lives inside the repository. I hadn't just deleted the code, I'd deleted all two years worth of posts!

Thankfully, I'd downloaded a backup of the data when I migrated hosts a couple of weeks back, so I was able to restore almost every post. A little finagling later, everything was back to how it was before the self-inflicted attack.

So, what do we learn? There's a reason people spend so much care on production deployments and backups are good.

Tune in next time for when I reinvent continuous deployment!