How to Back Up a PostgreSQL Database in DBeaver (The Easy Way)

Backing up a PostgreSQL database in DBeaver

Backing up your PostgreSQL database should be simple and repeatable. This guide walks you through creating a clean SQL dump using DBeaver, with settings that make restores smooth across different servers. Follow along step by step.

What You’ll Need

  • DBeaver installed on your machine
  • Access to your PostgreSQL database
  • The pg_dump client installed and accessible on your system

Step 1: Install DBeaver

  1. Download DBeaver from the official website and install it.
  2. Linux users: If you installed DBeaver via Snap, remove the Snap version first. Snap apps are sandboxed and may block access to root-level directories outside the app’s installation folder.

Step 2: Open the Backup Tool

  1. Launch DBeaver and connect to your PostgreSQL database.
  2. In the Database Navigator, right-click your database.
  3. Select Tools > Backup.

Step 3: Point DBeaver to pg_dump

  1. In the Backup dialog, click Load Client.
  2. Browse to your pg_dump executable.
    • Linux tip: It’s typically located in /usr/bin/.

Step 4: Choose What to Back Up

  1. Select the schemas you want to include in the backup.
  2. Click Next.

Step 5: Use a Plain SQL Format

  1. Set Format to Plain.

Optional: Make the Dump Easier to Restore Elsewhere

If you plan to restore on a different server or under a different user, consider creating a dump without ownership and privilege statements. This keeps the SQL portable and avoids permission conflicts during restore.

Note: The user who runs the restore will become the owner of the restored objects.

Step 6: Adjust Ownership and Privilege Options

  1. Enable the following options:
    • Do not backup privileges (GRANT/REVOKE)
    • Discard objects owner

Step 7: Start the Backup

  1. Click Start.
  2. Wait for the process to complete. You should find the SQL dump file in your selected output directory.

Where to Find Your Dump

After the backup finishes, DBeaver saves the .sql file to the directory you chose in the Backup dialog. Keep this file safe and consider versioning it if you are managing multiple environments.

Why These Settings?

  • Plain format: Produces human-readable SQL that you can inspect, version-control, and run with standard PostgreSQL tools.
  • Without privileges and ownership: Avoids restore-time permission errors and makes it easier to import into a fresh database or under a different user.

Quick Restore Tip

To restore a Plain SQL dump, you can use psql from the command line:

psql -h <host> -U <user> -d <database> -f /path/to/backup.sql

Final Thoughts

This setup gives you a portable, clean backup that is easy to restore in development, staging, or production. Run backups regularly and store them in a secure location. If you automate this process, keep the same options to ensure consistency.

You might also like

More stories worth your time — dive in while you are here.

Comments

Sign in with GitHub to comment or react. Threads live in GitHub Discussions, so you can also reply from GitHub.