Db backup restore
Safely back up and restore a Postgres/Supabase database — pg_dump/pg_restore, Supabase backups/PITR, and a no-data-loss restore runbook. Use before risky migrations, for disaster recovery, or when cloning prod to staging.From its SKILL.md
npx -y skills add m-binimran/dev-pack --skill db-backup-restoreAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 2 commands, including `pg_dump --format=custom --no-owner --file=backup.dump "$DATABASE_URL"` and 1 more.
SKILL.md
1.7 KB, 342 tokens by cl100k_base, as published. Nobody here has run it
db-backup-restore
Backups are only real if you've restored one. Treat restore as the thing you're actually buying.
Back up
- Logical (portable):
pg_dump --format=custom --no-owner --file=backup.dump "$DATABASE_URL". Custom format restores selectively and in parallel. - Supabase: managed daily backups; enable Point-in-Time Recovery (PITR) for anything important.
- Before a risky migration: take a fresh dump first. Note the timestamp and what it covers.
- Store backups off the database host. Never commit a dump (it's data — and may contain PII).
Restore (runbook)
- Restore into a NEW/empty target first (staging or a scratch DB), never straight over a live one:
pg_restore --no-owner --clean --if-exists -d "$TARGET_URL" backup.dump - Verify row counts and a few key records match expectations before pointing anything at it.
- Only then, if replacing prod, do it in a maintenance window with a fresh backup taken immediately prior.
Safety
- Never restore over production without an explicit human OK and a just-taken backup. A restore is destructive — it can overwrite newer data.
- Test the restore path periodically; an untested backup is a hope, not a recovery plan.
- Scrub or limit PII when cloning prod → staging.
Output
- The exact backup/restore commands for the situation, the target (never prod by default), and the verification step. State clearly when an action is destructive.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.