From 2b49ae79ca22f9ef434eb8ca4b7d229ba72a5958 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 16 Mar 2023 11:23:22 +0200 Subject: [PATCH] Use just for Postgres maintenance command examples --- docs/importing-postgres.md | 14 +++++++------- docs/maintenance-postgres.md | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/importing-postgres.md b/docs/importing-postgres.md index a44afdcf..150164e7 100644 --- a/docs/importing-postgres.md +++ b/docs/importing-postgres.md @@ -20,18 +20,18 @@ Before doing the actual import, **you need to upload your Postgres dump file to ## Importing -To import, run this command (make sure to replace `` with a file path on your server): +To import, run this command (make sure to replace `SERVER_PATH_TO_POSTGRES_DUMP_FILE` with a file path on your server): ```sh -ansible-playbook -i inventory/hosts setup.yml \ ---extra-vars='server_path_postgres_dump= postgres_default_import_database=matrix' \ ---tags=import-postgres +just run-tags import-postgres \ +--extra-vars=server_path_postgres_dump=SERVER_PATH_TO_POSTGRES_DUMP_FILE \ +--extra-vars=postgres_default_import_database=main ``` **Notes**: -- `` must be a file path to a Postgres dump file on the server (not on your local machine!) -- `postgres_default_import_database` defaults to `matrix`, which is useful for importing multiple databases (for dumps made with `pg_dumpall`). If you're importing a single database (e.g. `synapse`), consider changing `postgres_default_import_database` accordingly +- `SERVER_PATH_TO_POSTGRES_DUMP_FILE` must be a file path to a Postgres dump file on the server (not on your local machine!) +- `postgres_default_import_database` defaults to `main`, which is useful for importing multiple databases (for dumps made with `pg_dumpall`). If you're importing a single database (e.g. `synapse`), consider changing `postgres_default_import_database` accordingly ## Troubleshooting @@ -86,7 +86,7 @@ In this case you can use the command suggested in the import task to clear the d # systemctl start matrix-postgres ``` -Now on your local machine run `ansible-playbook -i inventory/hosts setup.yml --tags=setup-postgres` to prepare the database roles etc. +Now on your local machine run `just run-tags setup-postgres` to prepare the database roles etc. If not, you probably get this error. `synapse` is the correct table owner, but the role is missing in database. ``` diff --git a/docs/maintenance-postgres.md b/docs/maintenance-postgres.md index f2ca907d..cc8898a2 100644 --- a/docs/maintenance-postgres.md +++ b/docs/maintenance-postgres.md @@ -41,7 +41,7 @@ To perform a `FULL` Postgres [VACUUM](https://www.postgresql.org/docs/current/sq Example: ```bash -ansible-playbook -i inventory/hosts setup.yml --tags=run-postgres-vacuum,start +just run-tags run-postgres-vacuum,start ``` **Note**: this will automatically stop Synapse temporarily and restart it later. You'll also need plenty of available disk space in your Postgres data directory (usually `/matrix/postgres/data`). @@ -78,7 +78,9 @@ Upgrades must be performed manually. This playbook can upgrade your existing Postgres setup with the following command: - ansible-playbook -i inventory/hosts setup.yml --tags=upgrade-postgres +```sh +just run-tags upgrade-postgres +``` **Warning: If you're using Borg Backup keep in mind that there is no official Postgres 15 support yet.**