doc:appunti:linux:sa:matrix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:matrix [2021/01/21 13:04] – [Migrazione da SQLite a Postgres] niccolo | doc:appunti:linux:sa:matrix [2021/01/21 16:40] – [Migrazione da SQLite a Postgres] niccolo | ||
---|---|---|---|
Line 309: | Line 309: | ||
===== Migrazione da SQLite a Postgres ===== | ===== Migrazione da SQLite a Postgres ===== | ||
- | L' | + | L' |
- | Il pacchetto | + | Verificate che siano installati i pacchetti |
+ | |||
+ | * **postgresql** - Object-relational SQL database | ||
+ | * **python3-psycopg2** - Python 3 module for PostgreSQL | ||
+ | * **libpq5** - PostgreSQL C client library | ||
+ | |||
+ | Cambiare utente in **postgres** ed eseguire nella shell **psql** i seguenti comandi SQL: | ||
+ | |||
+ | <code sql> | ||
+ | CREATE USER synapse_user PASSWORD ' | ||
+ | CREATE DATABASE synapse | ||
+ | ENCODING ' | ||
+ | LC_COLLATE=' | ||
+ | LC_CTYPE=' | ||
+ | template=template0 | ||
+ | OWNER synapse_user; | ||
+ | </ | ||
+ | |||
+ | Nel file di configurazione **/ | ||
+ | |||
+ | < | ||
+ | server_name: | ||
+ | </ | ||
+ | |||
+ | Preparare una nuova versione del file di configurazione **/ | ||
+ | |||
+ | < | ||
+ | # Database configuration | ||
+ | database: | ||
+ | name: " | ||
+ | args: | ||
+ | user: synapse_user | ||
+ | password: MyDbSecret | ||
+ | database: synapse | ||
+ | host: 127.0.0.1 | ||
+ | cp_min: 5 | ||
+ | cp_max: 10 | ||
+ | </file> | ||
+ | |||
+ | Spostarsi nella directory **/var/lib/ | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh -xe | ||
+ | cd / | ||
+ | systemctl stop matrix-synapse.service | ||
+ | synapse_port_db \ | ||
+ | --sqlite-database / | ||
+ | --postgres-config / | ||
+ | mv / | ||
+ | mv / | ||
+ | systemctl start matrix-synapse.service | ||
+ | </ | ||
+ | |||
+ | La nostra ricetta semplificata **tiene fermo il servizio Matrix per tutto il tempo della migrazione**. Con database di una certa dimensione questa operazione potrebbe richiedere diversi minuti; vedere le **[[https:// | ||
===== Web References ===== | ===== Web References ===== |
doc/appunti/linux/sa/matrix.txt · Last modified: 2024/04/15 16:46 by niccolo