Document Synapse database restore pitfalls per the official backup guide

Add the two remaining hints from the official Synapse backup guide:

- never import a dump into a database that already has tables present
  (at best it errors, at worst it causes subtle inconsistencies)
- when restoring a backup older than the server's current state,
  truncate e2e_one_time_keys_json before starting Synapse, so used
  one-time keys are not re-issued (which causes decryption errors);
  our pg_dumpall-based backup commands include that table

Fixes #4004

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-07-14 14:34:45 +03:00
parent 635bb61424
commit 534631c1e7
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -76,6 +76,8 @@ If you are using an [external Postgres server](configuring-playbook-external-pos
Restoring a backup made this way can be done by [importing it](importing-postgres.md).
**Note for Synapse users**: the [official Synapse backup guide](https://element-hq.github.io/synapse/latest/usage/administration/backups.html) recommends that the `e2e_one_time_keys_json` table either not be backed up, or be truncated after restoring (before Synapse is started). The full-server dump command above does include it, so if you ever restore a backup that is older than the server's current state, remember to truncate that table as described in [the importing guide](importing-postgres.md).
## Upgrading PostgreSQL
Unless you are using an [external Postgres server](configuring-playbook-external-postgres.md), this playbook initially installs Postgres for you.