Upgrading LeonsDB

Upgrade the server first, then the plugins, then the dashboard. A newer server works with older plugins: a plugin that cannot use something new goes on without it. The dashboard refuses to start against a server older than it needs, and says so.

Before any upgrade, make a backup (leonsdb backup now) and read the release notes for that version.

Linux, installed with install.sh

Unpack the new download and run its installer, as for the first install:

tar xzf leonsdb-<version>-linux-amd64.tar.gz
cd leonsdb-<version>-linux-amd64
sudo ./deploy/install.sh

It stops LeonsDB, copies its data to /var/backups/leonsdb/pre-upgrade-<old version>-<time>.tar.gz (the last three are kept), installs the new program, starts it, and waits until it is ready. Your configuration is left as it is. The previous program stays as /usr/local/bin/leonsdb.previous.

If the new version does not start, the installer prints how to go back:

sudo systemctl stop leonsdb
sudo cp -p /usr/local/bin/leonsdb.previous /usr/local/bin/leonsdb
# only if the data was changed: put the copy back
sudo rm -rf /var/lib/leonsdb && sudo tar -C /var/lib -xzf /var/backups/leonsdb/pre-upgrade-<...>.tar.gz
sudo systemctl start leonsdb

Windows

In an administrator prompt, stop the service, replace leonsdb.exe with the new one, and start it again:

sc stop LeonsDB
copy /y <new download>\leonsdb.exe C:\LeonsDB\leonsdb.exe
sc start LeonsDB

(sc stop returns before LeonsDB has finished; wait until sc query LeonsDB says STOPPED before copying.) Keep the old leonsdb.exe until the new one runs well.

Docker

Load the new image and recreate the container; the data stays in its volume:

docker load -i leonsdb-<version>-docker-amd64.tar.gz
LEONSDB_VERSION=<version> docker compose up -d

Plugins

Replace the jar in each Minecraft server’s plugins/ folder and restart that server, one at a time if you like: players on the others go on playing.

Going back to an older version

A newer version may store data in a way an older one cannot read. Going back is safe only with the data from before the upgrade: the pre-upgrade copy on Linux, or a backup made before it (leonsdb restore, see Backups).