Fix instructions for switching to PGroonga

This commit is contained in:
itepechi 2023-08-06 08:07:19 +09:00
parent 059f3c4299
commit 5c19b8820f
1 changed files with 18 additions and 26 deletions

View File

@ -161,13 +161,24 @@ Follow the printed link to set your password.
#### Switch to PGroonga #### 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 ```ex
podman stop akkoma-web 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 ```ex
config :pleroma, :database, config :pleroma, :database,
@ -175,32 +186,13 @@ config :pleroma, :database,
pgroonga_enabled: true # set this option to true 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 ```sh
podman run -d \ podman restart akkoma-web
--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
``` ```
You can revert the applied changes anytime by replacing `migrate` with `rollback`. You can revert the applied changes at any time 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
```
--- ---