Skip to content

Instantly share code, notes, and snippets.

@johndevs
Created October 22, 2023 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndevs/163b5a2c1f73bdb3c653d5a495f83e9a to your computer and use it in GitHub Desktop.
Save johndevs/163b5a2c1f73bdb3c653d5a495f83e9a to your computer and use it in GitHub Desktop.
Clone Postgres database
PGPASSWORD=[source password] pg_dump -h [DB_hostname] -U [username] -W -d [source_database] -v -Fc | PGPASSWORD=[destination password] pg_restore -h [DB_hostname] -U [username] -W -v -d [destination_database]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment