4. Updates, rollback and delta updates
This guide describes Lawliet 1.5.13.s (the current release). Screens, commands and procedures may change in later versions; the usage guide is updated with each release. Check the version your server runs under Settings > Platform or with ./lawliet version, and see the Releases page for what changed.
How to move the server to a new version, how to go back, and how the smaller delta updates work.
| You need | |
|---|---|
| On the server | Root (or sudo) in the current installation directory |
| In the console (optional route) | Permission Manage platform updates; four-eyes: Stage a platform update |
| Downtime | A few minutes, from stopping the old version until the new one is healthy |
| Agents | Keep running; they hold their data and send it once the server answers again |
4.1 Before you update#
Read the release notes that came with the version.
Check the current state. Fix anything red first:
sudo ./lawliet status sudo ./lawliet doctorNote the build id from
status(you may need it for support).Check disk space in the parent of the installation directory. The update unpacks the new version beside the current one and needs about twice the bundle's size free:
df -h "$(dirname "$PWD")"Plan a short maintenance window. The console is unavailable for a few minutes.
Have a copy of the latest backup off the server (Backup and restore). The update takes its own backup too, and refuses to continue if that fails.
Risk: the update stops the running version and migrates the database to the new schema. Rollback: sudo ./lawliet rollback from the new directory returns to the old version with the database as it was before the update (4.6).
4.2 Get the new bundle onto the server#
As for the installation (Installation, 2.3): download the bundle and its .sha256, check it with sha256sum -c, carry it to the server, and check it again there. Put it anywhere on the server, for example /media/usb or /opt/incoming. Do not unpack it over the current installation.
The update checks the bundle's vendor signature itself, before any of it runs. The checksum check protects the copy; the signature check protects against a bundle that was not made by the vendor.
4.3 Update from a file (the standard route)#
Go to the current installation directory:
cd /opt/lawliet-<current>Run the update with the path to the new bundle:
sudo ./lawliet update /opt/incoming/lawliet-docker-<new>-<customer>.tar.gzWait. Do not interrupt it. It prints each step:
Section What happens Upgrade Shows From <current version>andUsing <file>Rebuilding the new version from the delta Only for a delta (4.7) Backing up before anything changes A full backup into ./backups. A failure stops the updateUnpacking Checks space and unpacks beside the current directory. OK New bundle: lawliet-<new>Checking the new bundle's signature OK Signed by the vendor; every file matches its manifest, and nothing else is thereContinuing with <new>'s own update stepsThe new version's own script takes over from here Loading the new version's images While the current version is still running Carrying your configuration across .env, deployment settings, TLS certificate, backups. Records whatrollbackneedsStopping the current version Containers only. Volumes (your data) stay Starting the new version Database migrations run on the first start Verifying Schema at revision <rev>andRunning version <new>After the update The new version's post-update steps (4.5) What you see at the end:
Upgrade complete. New directory /opt/lawliet-<new> Old directory /opt/lawliet-<current> (keep it: ./lawliet rollback returns to it) Backup /opt/lawliet-<current>/backups/lawliet-<time>.sql.gz ! Run future commands from the new directory: cd /opt/lawliet-<new>Change to the new directory and check:
cd /opt/lawliet-<new> sudo ./lawliet statusSign in to the console and check the version in Settings > Platform (panel Deployment).
Update anything that points at the old directory: backup jobs (cron), monitoring scripts, runbooks.
The old directory stays. Keep it until you are sure you will not roll back.
An unpacked bundle directory is accepted in place of the .tar.gz. A bundle repacked as .zip is accepted only through the console upload (4.4).
If it fails#
Every refusal before Stopping the current version ends with The running version was not touched. Nothing needs undoing; fix the cause and run the same command again.
| Message | Cause and fix |
|---|---|
Backup failed - refusing to upgrade without one. | PostgreSQL is not answering, or the disk is full. Check sudo ./lawliet status |
Not enough disk space to unpack the new version | Free space in the parent directory |
Could not unpack <file> | The file is damaged or not a bundle. Check its .sha256 and copy it again |
Refusing <file>: it has no MANIFEST.json, so it is not a signed release bundle | Not a release bundle. Use the file exactly as delivered |
Refusing <file>: its MANIFEST.json signature does not verify with the release key | Not signed by the vendor, or changed after signing. Do not use it; ask the vendor |
Refusing <file>: <name> does not match its signed MANIFEST.json (changed or missing) | A file in the bundle was changed or is missing. Copy the bundle again from the original |
Refusing <file>: <name> is not in its signed MANIFEST.json (added after signing) | Something was added to the bundle. Use the bundle as delivered |
its signature cannot be checked here: install openssl | Install openssl from the OS media and run again |
The new version's images could not be loaded | Wrong CPU, damaged image, or a full disk. The message above it says which |
The new version did not start. | Data intact. Run cd /opt/lawliet-<new> && sudo ./lawliet rollback, or diagnose with sudo ./lawliet logs backend in the new directory |
Schema is at <rev>; this bundle ships <rev> or The API reports version <x>; this bundle is <y> | The new version is not really running. Data intact. The message gives both routes back |
Interrupted. (Ctrl-C) | The half-unpacked copy is removed. If the old version had already been stopped, the message says so and how to start it again |
4.4 Update through the console#
The console can receive and verify a bundle for you. It never applies it: a container cannot replace the images it runs from. The last step is always one command on the server.
Route A: upload a bundle (air-gapped sites)#
- Go to Settings > Platform, panel Platform updates, section Install from a file.
- Press Choose bundle (.tar.gz or .zip) and select the bundle as delivered. (Up to 2 GB. For a larger file, copy it to the server and use 4.3.)
- Four-eyes: the console shows Waiting for a second administrator to approve <file> (request #N). Keep the page open.
- The approver opens Approvals > Waiting for me, reads the request and presses Approve.
- Back in Settings > Platform, press Continue upload. If you had left the page, the approved request is listed there; choose the same file again.
- The server checks the signature and every file. What you see: <version> is staged and verified, ready to apply. and the command
./lawliet update --stagedwith a copy button. - On the server, in the current installation directory:
sudo ./lawliet update --stagedThis is the same update as 4.3. It checks the staged file's digest again before using it.
To drop a staged bundle without applying it, press Discard it.
Route B: the update feed#
Only when your vendor gave you an update feed address and UPDATE_FEED_URL is set in .env. Without it the panel says No update feed is configured, so this deployment makes no outbound requests and cannot see new versions.
- Settings > Platform > Platform updates > Check for updates.
- Download and verify for the version offered. Four-eyes: Stage a platform update.
- Apply on the server with
sudo ./lawliet update --staged.
If it fails#
| Message | Cause and fix |
|---|---|
The server refused the upload as too large. | Copy the bundle to the server and run ./lawliet update <bundle-file> |
The bundle could not be staged. Upload it exactly as supplied, without repacking. | The bundle failed its check. Use the file as delivered |
That is not the approved file: request #N is for <file> | Choose the file the approval was given for |
Nothing is staged. (on the server) | Nothing was staged, or it was discarded. Stage it again, or use 4.3 |
The staged bundle no longer matches the digest recorded when it was downloaded. | The file changed on disk. Discard it in the console and stage it again |
4.5 What happens after the update#
The new version runs these steps once, after it has started and been verified. None of them can fail the update; each reports what it could not do and the command to do it.
| Step | What it does |
|---|---|
| Rollback record | Writes the previous directory and the pre-update backup to .lawliet.conf for rollback |
| Certificate | A self-signed certificate that misses an address of this server, or expires within 30 days, is re-issued only if no agent is enrolled. With agents enrolled it is reported with the command sudo ./lawliet tls repair. A CA-issued certificate is only reported. Skipped while TLS is off, or with --no-cert-repair |
| Trusted host names | Adds any missing address of this server (and the names in the certificate) to TRUSTED_HOSTS, and restarts the backend only if the list changed |
| Health after the update | Running version, schema revision, services, certificate coverage |
4.6 Roll back#
Use this when the new version does not work for you. It returns to the version this one was updated from with the database as it was before the update.
| You need | |
|---|---|
| The previous installation directory | Still present (the update kept it) |
| The pre-update backup | Present, complete, from the previous version's schema, made under the same encryption keys |
| Downtime | A few minutes |
Risk: everything written after the update (alerts, events, agents enrolled, users and settings changed) is not in the restored database. It is saved to a separate dump first and is not lost, but going back means working without it. Rollback of the rollback: run the update again later; the data written in between can be loaded only into the newer version (./lawliet restore of the saved dump from the newer directory).
Procedure#
Go to the new (current) directory:
cd /opt/lawliet-<new>Run:
sudo ./lawliet rollbackRead the summary and answer the question:
From <new> (/opt/lawliet-<new>) Back to <old> (/opt/lawliet-<old>) Database from <pre-update dump> (schema <rev>) Current data saved to /opt/lawliet-<new>/backups/before-rollback-<time>/ ! Anything written since the update (<time>) is not in the restored database: ... Roll back to <old>? (y/N)If settings in
.envchanged since the update (for example a licence installed), it names them. The old version runs with its own.env, so install such a licence again afterwards withsudo ./lawliet licence <key>.It then: stops the application, saves the current database to
backups/before-rollback-<time>/, stops the new version, restores the pre-update backup into the old version's database, starts the old version from its own directory, and verifies health, version and schema.What you see:
Rolled back to <old>. Running from /opt/lawliet-<old> Newer data saved in /opt/lawliet-<new>/backups/before-rollback-<time> This directory /opt/lawliet-<new> (kept; nothing was deleted) ! Run future commands from the previous directory: cd /opt/lawliet-<old>Change to the old directory and check:
cd /opt/lawliet-<old> && sudo ./lawliet status.
When there is no rollback record#
For an update finished by a version older than 1.5.12.s, or files moved by hand, name the pair yourself:
sudo ./lawliet rollback --to /opt/lawliet-<old> --backup /opt/lawliet-<old>/backups/lawliet-<time>.sql.gzUse the dump the update took (the newest lawliet-<time>.sql.gz in the old directory's backups/ from just before the update).
If it fails#
Each check below happens before anything changes and ends with Nothing was changed.
| Message | Cause and fix |
|---|---|
No record of the version this one was updated from | Use --to and --backup as above |
The previous installation's directory ... no longer exists | It was deleted. Rollback is not possible; restore a backup into the current version instead |
Cannot roll back: <dump> is missing (or empty, or has no tables) | Give the right dump with --backup |
The backup ... is at schema revision X, but <old> ships Y | That dump is not the old version's database. Give the right pair |
The backup was taken under different encryption keys than <old>/.env holds | The pair does not belong together. Give the right pair |
This installation was already rolled back to <dir> | It is done. Work from that directory |
Rollback incomplete. | The message says where the newer data is and to restore before starting: never start a version on a database that is not its own |
Do not try to roll back by running an older bundle's update over a newer database: the older backend refuses a database migrated by a newer version ("Can't locate revision").
4.7 Delta updates#
A delta carries only what changed between the build you have installed and a newer one, for one CPU. It is much smaller than a full bundle. You apply it with the same command:
sudo ./lawliet update /opt/incoming/lawliet-delta-<old>-<build>-to-<new>-<build>-amd64.tar.gzA delta is made for one exact build: the build id of your installation (shown by ./lawliet status). Before the backup, and while the current version keeps running, the update checks the delta with your installed backend image, with no network:
- the delta's signature, and that this installation is the build it was made for;
- that the files and image layers it reuses are unchanged since install;
- that the rebuilt bundle equals the new version's own signed manifest.
Then it rebuilds the complete new bundle beside the current directory and continues exactly as a full update (4.3).
What you see: the delta checks, each marked OK, then the same output as a full update. Roll back as after a full update (4.6).
Keep the images/ folder of the installation directory: a delta reuses the layers in it.
If it fails#
| Message | Cause and fix |
|---|---|
The delta was refused: This delta needs build <id> (<version>); this installation is build <id> | The delta is for a different build. Ask the vendor for a delta from your build id, or use the full bundle |
This installation predates delta updates, so it cannot apply one. | Installations from 1.5.11.s and earlier. Apply the next full bundle once; deltas work from then on |
The installed backend image ... is not loaded | Run sudo ./lawliet start, then the update again |
A path contains a double quote | Rename the file or directory and run again |
Every delta refusal ends with The running version was not touched.
4.8 After you are satisfied#
- Keep the old directory at least until the next update. Deleting it removes the ability to roll back.
- Docker keeps the old version's images. They are tagged with the old version and build id (
lawliet-backend:<version>-<build id>and so on). Removing them is optional, and only after you no longer need the old directory. - Copy the new directory's
backups/off the server as usual.

