Skip to content

Instantly share code, notes, and snippets.

@ceesco53
Forked from zmb3/backup.sh
Last active November 8, 2019 01:50
Show Gist options
  • Select an option

  • Save ceesco53/c0d9766ff313b350931b42748e429496 to your computer and use it in GitHub Desktop.

Select an option

Save ceesco53/c0d9766ff313b350931b42748e429496 to your computer and use it in GitHub Desktop.
Backup/Restore Concourse DB
# from Concourse DB VM:
# /var/vcap/packages/postgres-9.6.8/bin/psql -U vcap -d atc
# \l
# backup
cd /var/vcap/packages/postgres-9.6.8/bin
./pg_dump -U vcap -d atc --format=c --schema-only --file=concourse-schema.sql
./pg_dump -U vcap -d atc --format=c --data-only --file=concourse-data.sql
# restore
/var/vcap/packages/postgres-9.6.8/bin
./pg_restore -U vcap -d atc -v concourse-schema.sql
./pg_restore -U vcap -d atc -v concourse-data.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment