From 7f2bf0c5989692e472f356feb7470e4ebce70562 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 25 Jun 2022 07:39:41 +0800 Subject: [PATCH] add instructions to take a backup with pg_dump (#754) --- docs/docs/administer/running-sql-queries.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/docs/administer/running-sql-queries.md b/docs/docs/administer/running-sql-queries.md index 327421b6e..571b6a4e0 100644 --- a/docs/docs/administer/running-sql-queries.md +++ b/docs/docs/administer/running-sql-queries.md @@ -20,6 +20,19 @@ used from the local shell like so: -c "SQL_STATEMENT" ``` +In addition, the `pg_dump` utility is also bundled; this can be used to take +consistent backups of the database. To dump a copy of the database in the +standard SQL query format execute it like this (replace `/path/to/backup.sql` +with the location to create the SQL file): + +```shell +/opt/firezone/embedded/bin/pg_dump \ + -U firezone \ + -d firezone \ + -h localhost \ + -p 15432 > /path/to/backup.sql +``` + This can be useful for debugging or troubleshooting purposes. It can also be used to modify Firezone configuration data, but **this can have unintended consequences**. We recommend using the UI (or upcoming API)