LawlietRequest demo ↗

Upgrading

A new version arrives as a new signed bundle. It installs beside the current version, carries your data, settings and licence across, and leaves the previous version in place for a rollback. Nothing is downloaded, so updates work air-gapped.

Before you start

  • Read the release notes for every version between yours and the new one, in particular their Upgrading sections.
  • Copy the bundle to the server and check its SHA-256 against the one we sent.
  • The bundle must match the server's CPU: uname -m prints x86_64 or aarch64.
  • Make sure there is room for a second copy of the images beside the running ones.

Update with one command

From the directory of the installed version, as root or with sudo:

sudo ./lawliet update lawliet-docker-<version>-<organisation>.tar.gz
cd <the new directory the update names>
sudo ./lawliet status

In order, the command:

  1. takes a database backup, and stops if that fails, because a rollback needs it;
  2. checks there is room and unpacks the new bundle beside the current one;
  3. checks the new bundle's signature and that every file matches its manifest;
  4. verifies and loads the new bundle's images while the current version keeps running;
  5. carries across .env, the deployment settings, the TLS certificate and the backups directory;
  6. stops the running stack without touching its volumes and starts the new version from its own directory;
  7. waits for health, then checks that the database is at the schema revision the new bundle carries and that the API reports the new version.

A bundle for the wrong CPU, a damaged image file or a full disk stops the update before the running stack is stopped, so the current version is untouched. If either final check disagrees, the command fails, says which, and points at the routes back.

Run later commands from the new directory; the command prints its path. The lawliet script there is the new bundle's own. Then sign in to the console and check the version under Settings > Platform.

Full procedure: 4.3 Update from a file.

Upload the bundle from the console

Where the person holding the bundle is not the person with shell access, Settings > Platform, panel Platform updates, section Install from a file takes the same archive (up to 2 GB). Staging an update is a four-eyes action: a second administrator approves it under Approvals, then Continue upload sends the file. Uploading only stages it: the manifest's signature and every file in the archive are checked against it. Applying it is still done on the server with sudo ./lawliet update --staged, because a container cannot replace the images it runs from. Upload the archive exactly as you received it; repacking it changes the bytes the manifest describes, and the upload is refused. Where your vendor gave you an update feed (UPDATE_FEED_URL), Check for updates and Download and verify stage it the same way.

Full procedure: 4.4 Update through the console.

Roll back

The previous directory is left in place, with its own images. From the new directory:

sudo ./lawliet rollback

It shows what it will do and asks first. It saves the current database, stops the new version, restores the backup the update took before it began into the old version's database, starts the old version from its own directory, and checks health, version and schema. Everything written after the update is not in the restored database; it is kept in backups/before-rollback-<time>/ in the new directory. Settings changed in .env since the update, such as a licence installed, are named so you can apply them again.

For an update finished by a version older than 1.5.12.s, there is no rollback record; name the previous directory and the backup the update took:

sudo ./lawliet rollback --to /opt/lawliet-<old> --backup /opt/lawliet-<old>/backups/lawliet-<time>.sql.gz

Applying an older bundle over a newer database is refused on purpose: its backend does not know the newer schema and stops rather than guess. rollback is the supported route back.

Full procedure: 4.6 Roll back.

Updating from 1.5.8.s or earlier: if the first update to a bundle with images fails, the old version's command suggests ./lawliet start --build. That needs the internet. Use plain ./lawliet start in the old directory instead; its images are still on the server.

Delta updates

A delta carries only what changed between the build you have installed and a newer one, for one CPU, and is much smaller than a full bundle. It is applied with the same command, sudo ./lawliet update <delta file>. A delta is made for one exact build, the build id that ./lawliet status shows: before anything changes, the update checks the delta's signature, that this installation is that build and that the files it reuses are unchanged, then rebuilds the complete new bundle and continues as a full update. Keep the installation's images/ folder, which a delta reuses. Installations from 1.5.11.s and earlier apply one full bundle first; deltas work from then on.

Full procedure: 4.7 Delta updates.

From 1.5.9.s or 1.5.10.s to 1.5.11.s

1.5.11.s includes every 1.5.10.s fix, so a 1.5.9.s installation updates straight to it. Agents stay at 2.1.8.s and need no upgrade.

sudo ./lawliet update lawliet-docker-1.5.11.s-<organisation>.tar.gz
cd <the new directory the update names>
./lawliet status
sudo ./lawliet tls repair          # once, only if start or status warns
  • The certificate. From 1.5.11.s on, an update checks the certificate when it finishes. An update from 1.5.9.s or 1.5.10.s is run by the installed version's update, which predates that check, so the new version's start and status report the gap instead: certificate does not cover <ip>; run: sudo ./lawliet tls repair. Run it once from the new directory. With agents enrolled it lists them and asks first; give each the new certificate as described in when the server's certificate changes.
  • The database. Migrations apply automatically on start: each agent's enrolment scheme and clock offset, the remote-deployment checklist, enrolment codes for offline packages, and directory sign-in.
  • Encryption. The state is kept: an installation behind nginx reads as encryption on, and a plain-HTTP installation reads as off until sudo ./lawliet tls on.
  • Directory sign-in. The AD_* environment variables used by the earlier Active Directory login are no longer read. Configure directory sign-in in Settings > Authentication.
  • Going back. The schema moves, so returning to 1.5.9.s or 1.5.10.s means starting the previous directory and restoring the backup the update took; see Roll back.

The agents

Agents are upgraded separately from the server, with signed releases that can be hosted on the server itself. See agent upgrades.