Преглед на файлове

recommend a better way of backing up postgres

don't spawn an extra container
run pg_dumpall within matrix-postgres instead, ensures correct version
store under /matrix so a backup of the folder will contain a DB dump
use absolute paths just in case something in the ENV is messed up
pull/901/head
Marc Leuser преди 5 години
родител
ревизия
53869ac14a
променени са 1 файла, в които са добавени 4 реда и са изтрити 7 реда
  1. +4
    -7
      docs/maintenance-postgres.md

+ 4
- 7
docs/maintenance-postgres.md Целия файл

@@ -51,15 +51,12 @@ ansible-playbook -i inventory/hosts setup.yml --tags=run-postgres-vacuum,start
To make a back up of the current PostgreSQL database, make sure it's running and then execute a command like this on the server: To make a back up of the current PostgreSQL database, make sure it's running and then execute a command like this on the server:


```bash ```bash
docker run \
--rm \
--log-driver=none \
--network=matrix \
/usr/bin/docker exec \
--env-file=/matrix/postgres/env-postgres-psql \ --env-file=/matrix/postgres/env-postgres-psql \
docker.io/postgres:13.1-alpine \
pg_dumpall -h matrix-postgres \
matrix-postgres \
/usr/local/bin/pg_dumpall -h matrix-postgres \
| gzip -c \ | gzip -c \
> /postgres.sql.gz
> /matrix/postgres.sql.gz
``` ```


If you are using an [external Postgres server](configuring-playbook-external-postgres.md), the above command will not work, because the credentials file (`/matrix/postgres/env-postgres-psql`) is not available. If you are using an [external Postgres server](configuring-playbook-external-postgres.md), the above command will not work, because the credentials file (`/matrix/postgres/env-postgres-psql`) is not available.


Зареждане…
Отказ
Запис