When the updater runs on the installation, updating in the interface is the most convenient — Updating with the updater describes it. Here is the same procedure from the command line; it always works, with the updater or without it. All the commands run in the installation directory.
Updating to a new version
Every release is a new bundle. Either hand it to the command directly:
./draften update --bundle /path/to/draften-<new version>.tar
or copy it into the updates/ folder and run:
./draften update <new version>
The web is switched over without an outage during an update. The update goes step by step:
- it checks the bundle against the installed release's keys — before it uses anything from it,
- it saves a database dump into
backups/(the last three backups from before an update are kept, the number is set byDRAFTEN_BACKUPSin.env; the daily backups are counted apart, see Backup and restore), - it runs the database migrations,
- it replaces the workers,
- it starts the new version of the web beside the one that serves, and switches to it once it is healthy,
- it replaces the containers of the other services (proxy, cloudflared, updater) whose image the new release changes; the others keep running. It never replaces the database.
If the new version does not become healthy, nothing is switched and the previous one keeps serving.
When a release changes the proxy or cloudflared image, the connection is briefly interrupted while it is replaced: for the proxy for a fraction of a second up to a few seconds, for the Cloudflare Tunnel for a few seconds. The release notes state this, and in the output of ./draften update the line proxy: new image … - recreating it (a short gap) announces it.
An own PROXY_IMAGE or CLOUDFLARED_IMAGE in .env takes precedence over the version the release brings. The update does not change it, so you get neither the new version of the proxy or cloudflared nor its security fixes. We recommend deleting the line from .env; then the version from the release applies.
A bundle can be checked without installing it, too:
./draften check draften-<new version>.tar
After updating
./draften status
shows which web colour serves, the version and the health of both colours and the workers, the HTTPS status and the database dumps. On the Operations page the workers check in and the verdict is "capacity is enough". What the release changed is in the NOTES.md file.
Going back to the previous version
The version that served before the update keeps running without traffic. You switch to it immediately:
./draften rollback
This works because the database stays readable for the previous version too.
Going back to an even older version
That only leads through restoring a database dump. Every dump in backups/ carries in its name the version that was running when it was made (<time>-<version>.sql.gz before an update, <time>-<version>.backup.sql.gz daily and on request):
docker compose stop worker
gunzip -c backups/<dump>.sql.gz | docker compose exec -T db sh -c 'mariadb -uroot -p"$MARIADB_ROOT_PASSWORD"'
./draften update <version> --no-backup
Everything that happened in draften after the dump was made is lost.
A dump from before the encryption key was replaced opens only with the previous key, MASTER_KEY_PREVIOUS in .env. See Backup and restore.
A machine without internet
The updater downloads new releases with the key from the licence. A machine without internet downloads nothing: copy the bundle into updates/ and update with ./draften update <version> — or the updater offers it to you from there in the interface.
What does not change by itself
- Assistants' settings, instructions and sources are in the database, and an update does not touch them.
- An Entra registration's client secret expires by how long you issued it for; renew it in the interface (Organisation → Sign-in and mail access → Registrations for shared mailboxes and central management → New secret), not by updating.
- The HTTPS certificate you renew yourself:
./draften certificate new.pem new.key.