How I set up automatic database backups in 30 minutes

2 min read
Bruce van Zyl
Bruce van ZylFounder
How I set up automatic database backups in 30 minutes

Restoring a database from a backup is something most builders never think about — until it's 2 a.m., your agent broke something in the live app, and suddenly it's the only thing that matters. Then you're digging through backups trying to work out which one is safe to trust.

I read a post by Ryan Carson last week that fixes this, and I set it up the same day — on our own dashboard and a few client projects, under 20 minutes each. Worth passing along.

The idea is simple. A restore is rare, risky, and easy to get wrong, so you write it down once as a checklist and hand it to your coding agent (I use Devin). The agent loads it as a playbook and runs the steps in order: maintenance mode on, snapshot the current state, restore, check it worked, then bring the app back. No one's remembering steps at 2 a.m. — the agent follows them.

A few things I really like that Ryan suggested

  • Practice before you need it. A scheduled test restore finds the broken backup on a quiet Tuesday, not during a fire.
  • Two backups, not one. A fast "undo" to roll back to any moment (great for a bad migration), plus a separate off-site copy for the day the whole account is gone.
  • Clear Guardrails for Agent. Creates a snapshot before touching anything, stop if a check fails, never run the destructive path without you saying so.
  • A maintenance switch that flips in seconds, so you can freeze writes the moment something's wrong.

I was surprised to get it setup in under <30 min.

If you're shipping anything people rely on, it's worth doing. Here's Ryan's write-up — it covers the exact setup, including a real restore against live production with no data lost.

If you’re not following, highly recommend: @ryancarson.

Share this article