sysadmin:kb:backup_restore_postgresql_database

Backup/Restore PostgreSQL Database

  1. Use pg_dump to backup the database:
    sudo -Hu postgres pg_dump -d <database_name> -format-custom -f </path/to/backup/database.pgdump>
  1. Use pg_restore to load the database back up:
    sudo -Hu postgres pg_restore -d <database_name> -v -1 </path/to/backup/database.pgdump>
  • sysadmin/kb/backup_restore_postgresql_database.txt
  • Last modified: 2019/10/01 14:49
  • by mjorgensen