Skip to content
Shellbay

Databases · about 2 min · 3 steps

Back up a PostgreSQL database

Saves one PostgreSQL database to a compressed backup file in /var/backups/shellbay/postgres, readable by root only.

Runs on

  • Debian / Ubuntu: supported
  • RHEL / Fedora: supported
  • Alpine: supported

Before you start

  • Run the PostgreSQL workflow first.

What it changes on your server

  • Writes <database>-<date>.dump (pg_dump custom format) to /var/backups/shellbay/postgres, which only root can read.
  • The database keeps running; nothing in it changes.

What Shellbay asks you

  1. Which database?

    Enter the name of the database to back up. List PostgreSQL databases shows the names. Make sure the backup folder's disk has room for it.

    Database
    Text, up to 64 characters

    Example: shop

Steps

  1. Check the database
  2. Write the backup
  3. Check the backup can be read

Shellbay checks the server before the first step, and stops at the first step that fails.

When it's done

  • The backup is in /var/backups/shellbay/postgres. Copy it off the server too: a backup on the same disk doesn't survive losing the server.
  • To restore into an empty database: sudo -u postgres pg_restore -d ‹database› /var/backups/shellbay/postgres/<file>.dump