mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Update running-sql-queries.md
This commit is contained in:
@@ -20,19 +20,6 @@ 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) <!-- XXX: Remove
|
||||
@@ -43,6 +30,7 @@ Some examples of common tasks:
|
||||
* [Listing all users](#listing-all-users)
|
||||
* [Listing all devices](#listing-all-devices)
|
||||
* [Changing a user's role](#changing-a-users-role)
|
||||
* [Backing up the DB](#backing-up-the-db)
|
||||
|
||||
#### Listing all users
|
||||
|
||||
@@ -78,3 +66,18 @@ Set role to `'admin'` or `'unprivileged'`:
|
||||
-p 15432 \
|
||||
-c "UPDATE users SET role = 'admin' WHERE email = 'user@example.com';"
|
||||
```
|
||||
|
||||
#### Backing up the DB
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user