From 6b78680875d9e721d46e4f3d34047c6a3fbd2f33 Mon Sep 17 00:00:00 2001
From: DMRobertson
Assuming your PostgreSQL database user is called postgres
, first authenticate as the database user with:
su - postgres
+su - postgres
# Or, if your system uses sudo to get administrative rights
sudo -u postgres bash
Then, create a postgres user and a database with:
-# this will prompt for a password for the new user
+# this will prompt for a password for the new user
createuser --pwprompt synapse_user
createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse_user synapse
@@ -306,17 +306,17 @@ space on disk after porting to Postgres.
Firstly, shut down the currently running synapse server and copy its
database file (typically homeserver.db
) to another location. Once the
copy is complete, restart synapse. For instance:
-./synctl stop
+./synctl stop
cp homeserver.db homeserver.db.snapshot
./synctl start
Copy the old config file into a new config file:
-cp homeserver.yaml homeserver-postgres.yaml
+cp homeserver.yaml homeserver-postgres.yaml
Edit the database section as described in the section Synapse config
above and with the SQLite snapshot located at homeserver.db.snapshot
simply run:
-synapse_port_db --sqlite-database homeserver.db.snapshot \
+synapse_port_db --sqlite-database homeserver.db.snapshot \
--postgres-config homeserver-postgres.yaml
The flag --curses
displays a coloured curses progress UI.
@@ -326,12 +326,12 @@ newer snapshot.
To complete the conversion shut down the synapse server and run the port
script one last time, e.g. if the SQLite database is at homeserver.db
run:
-synapse_port_db --sqlite-database homeserver.db \
+synapse_port_db --sqlite-database homeserver.db \
--postgres-config homeserver-postgres.yaml
Once that has completed, change the synapse config to point at the
PostgreSQL database configuration file homeserver-postgres.yaml
:
-./synctl stop
+./synctl stop
mv homeserver.yaml homeserver-old-sqlite.yaml
mv homeserver-postgres.yaml homeserver.yaml
./synctl start
--
cgit 1.5.1