Sign inStart free trial
Help center › Databases

Back up and restore PostgreSQL

A consistent dump of each database, with the server's roles, on Linux.

LanguageEnglishRomana

The agent backs up each PostgreSQL database with pg_dump, PostgreSQL's own tool, while the database stays online. The dump goes straight into Beyond Cloud Vault, encrypted: nothing is written to the server's disk. Each backup also stores the server's roles (users and their rights), so a database can be restored on a server that doesn't have them yet.

Supported: PostgreSQL 12 and newer on Linux (Rocky, RHEL, Alma, Debian, Ubuntu), from the distribution's packages or from postgresql.org. Nothing else to install, and no password to store: the agent runs PostgreSQL's tools as the postgres user, which PostgreSQL lets in over its local socket.

1. Check the server on the Databases page

  1. Install the agent on the database server (Install on Linux).
  2. Open Beyond Cloud Backup → Databases. The PostgreSQL card shows the version and every database, with connected.

If the card shows an error, check that PostgreSQL is running (systemctl status postgresql) and that the postgres user can connect locally (su - postgres -c "psql -l").

2. Create the backup

  1. Go to Backup → the PostgreSQL card.
  2. Keep All user databases checked (databases created later are included automatically), or choose databases.
  3. Schedule: Full every day at 22:00 is a good start; add more runs a day if the data changes a lot.
  4. Choose retention and Save.

Every backup is a complete, consistent copy of the database at the moment it started.

3. Restore

Open Restore → the PostgreSQL card, choose the database and a restore point, then:

  • Whole database: creates the database with its original owner, encoding and locale, and loads the dump with pg_restore. Roles the database needs and this server lacks are created first. Restore under a new name (for example shop_copy) to check the data first, or tick Replace the existing database with this name to restore over it: its users are disconnected.
  • Backup files to a folder: the .dump file and the roles (globals_….sql), to load yourself: psql -f globals_….sql, then pg_restore -d <database> <file>.dump.

Good to know

  • Restore points are taken at the times of your schedule; restoring to any second in between (WAL archiving) is coming.
  • Restoring on another server: install the agent there with the same customer account and restore from the original server's backups: ask support if you need help.
Still stuck? Write to support. We answer within 4 working hours.Next: Back up and restore Oracle Database →