Skip to content

Instantly share code, notes, and snippets.

@emailrhoads
Last active November 12, 2020 19:06
Show Gist options
  • Select an option

  • Save emailrhoads/bcc4f756d072b2bfc6e1a566fa17168d to your computer and use it in GitHub Desktop.

Select an option

Save emailrhoads/bcc4f756d072b2bfc6e1a566fa17168d to your computer and use it in GitHub Desktop.
[Import PG Dump] Create new pg ddump import #gemini #postgres

Create new database

dropdb gemini_development
createdb gemini_development

Restore your dump

Postgres 9/10

pg_restore -j $(nproc) -c --no-owner --if-exists -d gemini_development <path to dump>

Postgres 11+

bundle exec rake db:drop db:create
pg_restore -h localhost -U railsuser -j $(nproc) -c --no-owner --if-exists -d gemini_development <path to dump>

Running on AWS

PGPASSWORD=$LUNA_DB_PASSWORD pg_restore -h $LUNA_DB_HOST -U $LUNA_DB_USER -j 2 -c --no-owner --if-exists -d $LUNA_DB tmp/libra_prod_07102020.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment