Skip to content

Instantly share code, notes, and snippets.

@airportyh
Created October 21, 2016 18:59
Show Gist options
  • Select an option

  • Save airportyh/b48590ba816f0f9a0a9f92d0f8dd7f36 to your computer and use it in GitHub Desktop.

Select an option

Save airportyh/b48590ba816f0f9a0a9f92d0f8dd7f36 to your computer and use it in GitHub Desktop.

Dump

$ pg_dump -Fc -d DBNAME -f DBNAME.dump

Replace DBNAME with the name of your database.

Restore

pg_restore -O -d DBNAME -h SERVER_IP -W DBNAME.dump -U postgres

Replace DBNAME with the name of your database and SERVER_IP with the IP address of your server.

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