StoicBuilder

HandbookIII the CastraBackups

IIIthe Castra, Stay in control

Backups

1 min readUpdated 28 November

In plain words

A backup is a copy of your database and files kept somewhere separate, so you can restore them after a bad migration, a buggy script or an accidental delete.

Where you see it

Your agent runs a migration that drops and recreates the notes table, and every note in Quill is gone. Git can bring back the code; only a database backup brings back the notes.

Terminalterminal
pg_dump "$DATABASE_URL" --format=custom --file=quill-2026-12-05.dumppg_restore --clean --dbname="$STAGING_DATABASE_URL" quill-2026-12-05.dump
Make a copy, then prove it works by restoring it somewhere that isn't production.

What goes wrong

  1. Never testing a restore

    A backup you've never restored is a hope, not a plan. Every few months, restore one into a spare database and point the app at it.

  2. Assuming your host keeps backups

    Plans differ: some keep none, some only a few days. Open your database's backup settings today, before you need them.

  3. Keeping the backup next to the data

    If the backup lives in the same project or account, one deleted project takes both. Store a copy somewhere else.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Before running any migration that drops, renames or rewrites a table, stop and tell me, and take a backup with pg_dump first. Then write down the exact command to restore that backup into a staging database so I can test it.

Quick check

Sign in to earn +10 XP for it

A migration deleted every QuickBite order from last week. What gets them back?

Got a prompt that touches backups?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.