synapse: Back up data using BURP

Most of the Synapse server's state is in its SQLite database.  It also
has a `media_store` directory that needs to be backed up, though.

In order to back up the SQLite database while the server is running, the
database must be in "WAL mode."  By default, Synapse leaves the database
in the default "rollback journal mode," which disallows multiple
processes from accessing the database, even for read-only operations.
To change the journal mode:

```sh
sudo systemctl stop synapse
sudo -u synapse sqlite3 /var/lib/synapse/homeserver.db 'PRAGMA journal_mode=WAL;'
sudo systemctl start synapse
```
This commit is contained in:
2023-05-23 09:42:54 -05:00
parent 74243080bb
commit 87e8ec2ed4
5 changed files with 24 additions and 0 deletions

View File

@@ -7,3 +7,11 @@ synapse_ldap_bind_dn: CN=svc.synapse,CN=Users,DC=pyrocufflink,DC=blue
synapse_ldap_bind_password: '{{ vault_synapse_ldap_bind_password }}'
matrix_tls_cert: websites/hatch.chat.cer
matrix_tls_key: websites/hatch.chat.key
burp_backup_script_pre: /etc/burp/backup-pre.sh
burp_restore_script_post: /etc/burp/restore-post.sh
burp_backup:
- include: /var/lib/synapse
- exclude: /var/lib/synapse/homeserver.db
- exclude: /var/lib/synapse/homeserver.db-shm
- exclude: /var/lib/synapse/homeserver.db-wal