Upgrade¶
Some versions may require changes to the database. These changes or database "migrations" are applied automatically and safely, but, it is recommended to take a backup of the Postgres database before running the --upgrade
option, especially if you have made customizations to the database tables.
Binary¶
- Download the latest release and extract the listmonk binary.
./listmonk --upgrade
to upgrade an existing DB. Upgrades are idempotent and running them multiple times have no side effects.- Run
./listmonk
and visithttp://localhost:9000
.
If you installed listmonk as a service, you will need to stop it before overwriting the binary. Something like sudo systemctl stop listmonk
or sudo service listmonk stop
should work. Then overwrite the binary with the new version, then run ./listmonk --upgrade, and
start` it back with the same commands.
If it's not running as a service, pkill -9 listmonk
will stop the listmonk process.
Docker¶
docker compose pull
to pull the latest version from DockerHub.docker compose run --rm app ./listmonk --upgrade
to upgrade an existing DB.- Run
docker compose up app db
and visithttp://localhost:9000
.
Railway¶
- 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".
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:
- Stop listmonk.
- Restore your pre-upgrade database.
- If you're using
docker compose
, editdocker-compose.yml
and changelistmonk:latest
tolistmonk:v2.4.0
(for example). - Restart.
Example with docker:
- Stop listmonk (app):
sudo docker stop listmonk_app
- 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
- Edit the
docker-compose.yml
:x-app-defaults: &app-defaults restart: unless-stopped image: listmonk/listmonk:v2.4.0
- Restart:
sudo docker compose up -d app db nginx certbot