Skip to content

Add pull-prod-db.sh to copy prod into the local dev DB - #130

Merged
JacobDChamberlain merged 1 commit into
mainfrom
pull-prod-db-script
Oct 11, 2026
Merged

JacobDChamberlain merged 1 commit into
mainfrom
pull-prod-db-script

Conversation

@JacobDChamberlain

Copy link
Copy Markdown
Owner

Adds backend/scripts/pull-prod-db.sh, a re-runnable command that replaces the local dev database with a copy of prod.

PROD_DATABASE_URL='<Render External Database URL>' backend/scripts/pull-prod-db.sh
  • Backs up the local DB to ~/maldevera-db-backups/ first
  • Dumps prod read-only, then drops/recreates/restores local
  • Picks the newest installed pg_dump (Homebrew's 14 shadows Postgres.app 16 on PATH) and checks it's at least prod's version
  • Asks you to type the DB name before dropping anything

Tested 2026-10-11: restored cleanly (14 products, 39 variants).

🤖 Generated with Claude Code

Backs up local first, dumps prod read-only, recreates and restores the
local DB, deletes the prod dump. Finds a pg_dump new enough for prod's
server rather than trusting PATH (Homebrew's 14 shadows Postgres.app 16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobDChamberlain
JacobDChamberlain merged commit ab4c158 into main Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant