mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-06-25 18:57:50 +02:00
Add support for upgrading Postgres
Since cbee084ac1
, this playbook supports Postgres 10.x,
but keeps existing Postgres-9.x installs on 9.x.
This playbook can now also be ran with `--tags=upgrade-postgres`
to make it upgrade from Postgres 9.x to 10.x (or other versions
in the future).
This commit is contained in:
22
README.md
22
README.md
@ -259,6 +259,28 @@ You can do it via this Ansible playbook (make sure to edit the `<your-username>`
|
||||
**Note**: `<your-username>` is just a plain username (like `john`), not your full `@<username>:<your-domain>` identifier.
|
||||
|
||||
|
||||
### Upgrading Postgres
|
||||
|
||||
If you're not using an external Postgres server, this playbook initially installs Postgres for you.
|
||||
|
||||
Once installed like that, this playbook attempts to preserve the Postgres version it starts with.
|
||||
This is because newer Postgres versions cannot start with data generated by an older Postgres version.
|
||||
An upgrade must be performed.
|
||||
|
||||
This playbook can upgrade your existing Postgres setup with the following command:
|
||||
|
||||
ansible-playbook -i inventory/hosts setup.yml --tags=upgrade-postgres
|
||||
|
||||
**The old Postgres data directory is backed up** (by renaming to `/matrix/postgres-auto-upgrade-backup`).
|
||||
It stays around forever, until you **manually decide to delete it**.
|
||||
|
||||
As part of the upgrade, the database is dumped to `/tmp`, upgraded and then restored from that dump.
|
||||
To use a different directory, pass some extra flags to the command above, like this: `--extra-vars="postgres_dump_dir=/directory/to/dump/here"`
|
||||
|
||||
**ONLY one database is migrated** (the one specified in `matrix_postgres_db_name`, named `homeserver` by default).
|
||||
If you've created other databases in that database instance (something this playbook never does and never advises), data will be lost.
|
||||
|
||||
|
||||
## Uninstalling
|
||||
|
||||
**Note**: If you have some trouble with your installation configuration, you can just re-run the playbook and it will try to set things up again. You don't need to uninstall and install fresh.
|
||||
|
Reference in New Issue
Block a user