Helpbot please give me step by step instructions to upgrade from v0.15 to v0.16 without backup. I am using Debian 13.
I have the binary in opt/stalwart-mail/install
Helpbot please give me step by step instructions to upgrade from v0.15 to v0.16 without backup. I am using Debian 13.
I have the binary in opt/stalwart-mail/install
Thank you ideer2 for the link to the update and for trying to help.
I read those instructions multiple times but there is so much info that it is a bit confusing to me. I was looking for straight forward directions with binary not docker. And I donāt need a backup because I take a snapshot of the server and can go back to previous time no problem.
I was hoping for the bot to reply to my question.
Or perhaps someone would like to help by replying with instructions on how to update step by step in Debian 13 binary from v0.15 to v0.16. No need for backup.
Please can someone confirm I have these steps correct for upgrading my mail server:
$ curl -fLO raw.githubusercontentDOTcom/stalwartlabs/stalwart/refs/heads/main/resources/scripts/migrate_v016.py
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip install requests urllib3
(.venv) $ python migrate_v016.py dump
āurl mail.exampleDOTcom
āusername admin
āpassword adminPassword
āsettings settings.json
āprincipals principals.json
(.venv) $ python migrate_v016.py convert
āsettings settings.json
āprincipals principals.json
āconfig config.json
āoutput export.json
I WILL SKIP THE BACKUP OF THE DATABASE
Perform the migration
6a. Download the v0.16 binary. Grab the release matching the target platform from githubDOTcom/stalwartlabs/stalwart/releases/latest. Do not replace the running binary yet.
6b. Stop the old service.
$ sudo systemctl stop stalwart
$ sudo mv /usr/local/bin/stalwart /usr/local/bin/stalwart.v015
$ sudo mv /path/to/downloaded/stalwart /usr/local/bin/stalwart
$ sudo chmod 0755 /usr/local/bin/stalwart
$ sudo chown root:root /usr/local/bin/stalwart
$ sudo mv /path/to/config.json /etc/stalwart/config.json
$ sudo chown stalwart:stalwart /etc/stalwart/config.json
$ sudo chmod 0640 /etc/stalwart/config.json
$ sudo -u stalwart env
STALWART_RECOVERY_MODE=1
STALWART_RECOVERY_ADMIN=admin:someTemporaryPassword
/usr/local/bin/stalwart --config=/etc/stalwart/config.json
10a. Install new CLI
curl --proto ā=httpsā --tlsv1.2 -LsSf
githubDOTcom/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.sh | sh
10b. apply snapshot
$ export STALWART_URL=://127.0.0.1:8080
$ export STALWART_USER=admin
$ export STALWART_PASSWORD=someTemporaryPassword
$ stalwart-cli apply --file /path/to/export.json
11a. For systemd (typically /etc/systemd/system/stalwart.service), locate the ExecStart= line and change the --config= argument:
ExecStart=/usr/local/bin/stalwart --config=/etc/stalwart/config.json
11b. Then reload the unit:
$ sudo systemctl daemon-reload
$ sudo systemctl start stalwart
13a. Log in to the admin panel
Recalculate disk quotas
Create a permanent administrator
Create a real administrator account through Management ā Accounts, verify the new account can log in, and then remove STALWART_RECOVERY_ADMIN from:
the systemd environment file (for example /etc/stalwart/stalwart.env) and restart the service, or
the init.d defaults file, and restart the service
Can someone please confirm these are the right steps for me to upgrade from v0.15 to v.016 with Debian 13 with the binary (not docker). Am I missing any steps here?
I know I can test it but I just want to get some guidance from more experienced forum friends before I do this at 2 am on a weekend. I only have 6 email accounts and one domain. I have this mail server for my family.
I deleted the https from the post because it will only allow 2 links.
Thanks.
The canonical procedure is UPGRADING/v0_16.md in the repo, and it has an āOption A: Binary deployments (systemd/init.d)ā section thatās exactly your case. Condensed, for a Debian binary install already on 0.15.x:
With 0.15 still running, grab resources/scripts/migrate_v016.py, make a venv, pip install requests urllib3, then run it in dump mode (your URL, admin user/pass) to produce settings.json and principals.json, then convert mode to produce config.json and export.json.
First, one important point: the 0.16 first-start irreversibly wipes the old config and directory records and resets quotas. Your data on disk survives, but you do need a rollback point. Your server snapshot counts as that backup, so youāre fine as long as you can roll back to it if needed; donāt skip that.
Stop the 0.15 service (systemctl stop stalwart), keep the old binary, install the 0.16 binary into your /opt path, and put the generated config.json where the old config lived.
Start once in the foreground in recovery mode as the stalwart user: STALWART_RECOVERY_MODE=1 STALWART_RECOVERY_ADMIN=admin:tempPass /opt/ā¦/stalwart --config=/etc/stalwart/config.json. It wipes the incompatible subspaces, migrates the spam model, and listens only on 8080.
From another terminal, with stalwart-cli 1.0.2+ and STALWART_URL=http://127.0.0.1:8080, run stalwart-cli apply --file export.json.
Ctrl+C the foreground server, update your systemd unitās --config to the new config.json, remove the recovery env vars, and systemctl start stalwart. Then recalc disk quotas from the WebUI.
Iād genuinely recommend dry-running this on a throwaway 0.16 first, because the config model changed completely (no TOML, accounts must be user@domain, the old /api is replaced by JMAP). Full doc: stalwart/UPGRADING/v0_16.md at main Ā· stalwartlabs/stalwart Ā· GitHub.
As always, thank you Stalwart Team for taking the time to reply to my question and for numbering the steps I am to follow. I will definitely try these instructions to update to v0.16 this weekend. Per your recommendation, I will dry-run this on a throwaway 0.16 first.