From 2888dcdd4532f20d405f10b737e08c2ad9cb5a2f Mon Sep 17 00:00:00 2001 From: MaximilianKohler Date: Sat, 19 Aug 2023 21:10:44 -0700 Subject: [PATCH] Update upgrade.md (#1467) --- docs/docs/content/upgrade.md | 38 +++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/docs/content/upgrade.md b/docs/docs/content/upgrade.md index a240121f3..61b54ee08 100644 --- a/docs/docs/content/upgrade.md +++ b/docs/docs/content/upgrade.md @@ -17,4 +17,40 @@ Some versions may require changes to the database. These changes or database "mi - Head to your dashboard, and select your Listmonk project. - Select the GitHub deployment service. - In the Deployment tab, head to the latest deployment, click on the three vertical dots to the right, and select "Redeploy". -- ![Railway Redeploy option](https://user-images.githubusercontent.com/55474996/226517149-6dc512d5-f862-46f7-a57d-5e55b781ff53.png) + +![Railway Redeploy option](https://user-images.githubusercontent.com/55474996/226517149-6dc512d5-f862-46f7-a57d-5e55b781ff53.png) + +## Downgrade + +To restore a previous version, you have to restore the DB for that particular version. DBs that have been upgraded with a particular version shouldn't be used with older versions. There may be DB changes that a new version brings that are incompatible with previous versions. + +**General steps:** + +1. Stop listmonk. +2. Restore your pre-upgrade database. +3. If you're using docker-compose, edit `docker-compose.yml` and change `listmonk:latest` to `listmonk:v2.4.0` _(for example)_. +4. Restart. + +**Example with docker:** + +1. Stop listmonk (app): +``` +sudo docker container stop listmonk_app +``` +2. Restore your pre-upgrade db (required) _(be careful, this will wipe your existing DB)_: +``` +psql -h 127.0.0.1 -p 9432 -U listmonk +drop schema public cascade; +create schema public; +\q +psql -h 127.0.0.1 -p 9432 -U listmonk -W listmonk < listmonk-preupgrade-db.sql +``` +3. Edit the `docker-compose.yml`: +``` +x-app-defaults: &app-defaults + restart: unless-stopped + image: listmonk/listmonk:v2.4.0 +``` +4. Restart: +`sudo docker-compose up -d app db nginx certbot` +