From a7731009b643253e8a8ea5a535bb4a294aa9be95 Mon Sep 17 00:00:00 2001
From: Will Hunt <will@half-shot.uk>
Date: Tue, 23 Oct 2018 19:18:44 +0100
Subject: [PATCH] Add postgres migration guide

---
 docs/howto.md | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/docs/howto.md b/docs/howto.md
index bedbd66..3a38ba8 100644
--- a/docs/howto.md
+++ b/docs/howto.md
@@ -17,3 +17,17 @@ is formatted as https://discordapp.com/channels/``guildid``/``channelid``
 * e.g. To set Alice to Admin on her ``example.com`` HS on default config. (``config.yaml``)
   * ``npm run adminme -- -r '!AbcdefghijklmnopqR:example.com' -u '@Alice:example.com' -p '100'``
   * Run ``npm run adminme -- -h`` for usage.
+
+### Migrate to postgres from sqlite
+* Stop the bridge.
+* Create a new database on postgres and create a user for it with a password.
+    * We will call the database `discord_bridge` and the the user `discord`.
+* Install `pgloader` if you do not have it.
+* Run `pgloader ./discord.db postgresql://discord:password@localhost/discord_bridge`
+* Change the config so that the config contains:
+
+```yaml
+database:
+    connString: "postgresql://discord:password@localhost/discord_bridge"
+```
+* All done!
-- 
GitLab