Skip to content

Instantly share code, notes, and snippets.

@deneuv34
Created January 28, 2021 08:59
Show Gist options
  • Select an option

  • Save deneuv34/2d55568d8df28fc946834e10571981a9 to your computer and use it in GitHub Desktop.

Select an option

Save deneuv34/2d55568d8df28fc946834e10571981a9 to your computer and use it in GitHub Desktop.
Backup and Restore PostgreSQL

Backup

This command mean is backup data with plain .sql file to defined path output

$ pg_dump -x -h localhost -p 5432 -U bioskoponline -W -F p db_name > /path/to/file.sql

Restore

To restore the generated plain sql file, you can only restore by psql command:

$ psql -h localhost -U postgres -p 54321 db_name < /path/to/file.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment