From 5c19b8820ff4fec3ed7cd19f446c2009ad1f1dd0 Mon Sep 17 00:00:00 2001 From: itepechi <72330683+itepechi@users.noreply.github.com> Date: Sun, 6 Aug 2023 08:07:19 +0900 Subject: [PATCH] Fix instructions for switching to PGroonga --- README.md | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index db446ed78..a77aca475 100644 --- a/README.md +++ b/README.md @@ -161,13 +161,24 @@ Follow the printed link to set your password. #### Switch to PGroonga -Before moving forward, make sure you have stopped the backend for safety. +Before proceeding, make sure you set `config :pleroma, :database, pgroonga_enabled` to `false`. -```sh -podman stop akkoma-web +```ex +config :pleroma, :database, + rum_enabled: false, + pgroonga_enabled: false ``` -After stopping the backend, change `config :pleroma, :database, pgroonga_enabled` to `true`. +Then, run the command below to apply optional migrations to switch to PGroonga. + +```sh +podman exec -it akkoma-web \ + pleroma_ctl \ + migrate \ + --migrations-path priv/repo/optional_migrations/pgroonga +``` + +After running the migration, change `config :pleroma, :database, pgroonga_enabled` to `true`. ```ex config :pleroma, :database, @@ -175,32 +186,13 @@ config :pleroma, :database, pgroonga_enabled: true # set this option to true ``` -If you have command history enabled in your shell, all you need to do is remove the `--name NAME` option and add `pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/pgroonga` to the end of the command. +Don't forget to restart your backend for the changes to take effect. ```sh -podman run -d \ - --pod akkoma-pod \ - --restart unless-stopped \ # this option is optional (bruh) - # --name akkoma-web \ # make sure to remove this option to avoid name conflict - -e DB_NAME=YOUR_DB_NAME \ - -e DB_USER=YOUR_DB_USER \ - -e DB_PASS=YOUR_DB_PASS \ - -v ${PWD}/static/:/var/lib/akkoma/static/:Z \ - -v ${PWD}/uploads/:/var/lib/akkoma/uploads/:Z \ - -v ${PWD}/etc/:/etc/akkoma/:Z \ - akkoma \ - pleroma_ctl \ - migrate \ - --migrations-path priv/repo/optional_migrations/pgroonga +podman restart akkoma-web ``` -You can revert the applied changes anytime by replacing `migrate` with `rollback`. - -Don't forget to start the container you stopped at the beginning of this guide. - -```sh -podman start akkoma-web -``` +You can revert the applied changes at any time by replacing `migrate` with `rollback`. ---