Skip to content

Upgrade

Upgrades are a pull and a restart. The risk is not the containers; it is the database migration, which is one-way. Everything below exists to make sure you can go back.

For the step-by-step drill with the checks in order, see upgrade safely. For what changes in a specific release, see its release notes and upgrade notes for 1.0.

Before you start

  1. Take a backup and confirm it restores. A backup you have not restored is an assumption. See backup and restore.
  2. Record the digests you are running now. This is the rollback target.
    Terminal window
    docker compose -f docker-compose.yml -f docker-compose.prod.yml images
  3. Read the release notes for the version you are moving to, and every version you are skipping over.
  4. Verify the new artifacts before running them. See verify release artifacts.

Upgrade the control plane

Pin the new version in .env:

PRAXIS_VERSION=1.0.2

Then pull and restart:

Terminal window
docker compose -f docker-compose.yml -f docker-compose.prod.yml \
--profile bundled --profile proxy pull
docker compose -f docker-compose.yml -f docker-compose.prod.yml \
--profile bundled --profile proxy up -d

The backend applies outstanding database migrations on startup. Watch it come up rather than assuming it did:

Terminal window
docker compose -f docker-compose.yml -f docker-compose.prod.yml \
logs -f backend

Direct package updates become governed

From the release that adds Update Operations, updates from the package pages and the package API run as generated patch plans. Before upgrading:

  • make sure every host you update directly has an effective patch policy, either bound or as the fleet default; a host without one is refused;
  • review automation that calls the update endpoints. They no longer wait for the package command: accepted work answers 202 with an operation_id to read the outcome from, and work no policy allows answers 409. A host that does not reach every requested revision is reported as failed.
  • sync or import advisories if you apply security-only updates. A security-only update installs only a pending revision that an active applicable security advisory selects, and advisory feeds are off by default;
  • scan RPM hosts: a package whose epoch no scan has recorded cannot be updated directly until one does;
  • note that reboot handling changes for all patch plans: a reboot with unknown evidence is no longer scheduled, and the reboots of a completed rollout wave can be sent while the execution is still running.

See API and compatibility. The database change adds tables for operation records, request keys and undelivered audit events, and widens the update history version columns. Its downgrade discards those tables, leaves patch plans and executions in place, and narrows the columns again, which the database refuses while a longer version is stored.

Reboots become automatic

From the release that adds the reboot worker, Praxis sends due reboots and verifies sent ones on its own. Before upgrading:

  • finish or note the reboots still waiting. Patch plans approved before the upgrade have no record of the reboot window their approval covered, so Praxis sends none of their unsent reboots, automatically or on request: they are held with reboot_window_unapproved. Plan and approve the work again, or reboot the host through your own change process and then Skip the row. A new plan can only be run for hosts that still have package work to do. Direct updates confirmed before the upgrade keep the window recorded at confirmation, and their reboots become automatic;
  • act on patch plans still waiting for approval votes. They have no record of the reboot window either, and later votes add none, so a final vote would approve the package work and leave its reboots held. Before that vote, reject the approval, refresh the plan and request approval again;
  • review automation that calls the reboot endpoints. Send due reboots now also requires the approval to stand and to cover the window, the policy and window to be unchanged and open, and the sender to have scope over the host; it respects the run’s parallelism and a paused or canceled reboot batch;
  • if your hosts need more than 15 minutes to restart, set PRAXIS_REBOOT_VERIFY_TIMEOUT_SECONDS.

The database change adds the approved reboot window to patch plans, attempt and history columns to the reboot queue, and tables for paused or canceled reboot batches and worker status. Its downgrade discards them, including approved windows, pauses and cancellations, so stop the backend before downgrading. See reboot scheduling.

Confirm the upgrade

  • Every service reports healthy.
  • The login page loads and you can sign in.
  • Settings > License still shows the expected edition and host count.
  • A host detail page loads with current inventory.
  • One low-risk command runs against one host.

Rolling back

Rollback is a redeploy of the previous digests. It does not touch the registry and does not require deleting anything that was published.

Terminal window
export PRAXIS_VERSION=<previous>
docker compose -f docker-compose.yml -f docker-compose.prod.yml \
--profile bundled --profile proxy up -d

The database is the constraint. Migrations are not automatically reversed. If the new release changed the schema, the previous application version may not be able to read it, and the supported way back is to restore the backup you took before the upgrade. That is why proving the restore is step one rather than step four.

Schema changes that refuse to reverse

Some migrations decline to undo themselves rather than destroy data. The 1.0.1 migration that adds host descriptions is one: its downgrade aborts with an explanatory message if any host has a description stored, because dropping the column would discard text an operator typed. Clear those descriptions deliberately if you intend to lose them, then run the downgrade again. The migration changes nothing when it refuses.

The same migration also adds a uniqueness constraint on host addresses, and it refuses to apply while duplicate addresses exist, naming the addresses and the hosts using them. Resolve those hosts and re-run it.

Never roll back by deleting the newer version from the registry. Deletion breaks anyone who pinned that digest and destroys the record of what shipped. Deploy forward instead.

Upgrading the agent

The agent is versioned and released separately, and it never updates itself. Upgrading the control plane does not change agents already running on hosts.

The control plane serves a pinned agent release to hosts, and that pin does not move on its own. A deployment can serve a different published release without a rebuild by setting PRAXIS_AGENT_RELEASE_VERSION to an exact vX.Y.Z. Moving references such as latest are rejected, because hosts verify a checksum against whatever the control plane serves and that artifact must not change underneath them.

To update the agent on a host, verify and extract the new tarball and run sudo ./install.sh over the existing deployment. Configuration and identity material are preserved, so the host does not re-enroll and the change appears as a brief liveness gap. Rolling back is the same operation against the older tarball. See enroll hosts.

For air-gapped sites, drop the release assets into the directory named by PRAXIS_AGENT_ARTIFACT_DIR, default /opt/praxis/agent-artifacts, using their published filenames. A local artifact is preferred over the network path.

Order of operations

  1. Back up, and prove the restore.
  2. Upgrade the control plane and confirm it is healthy.
  3. Update agents in waves, starting with a small cohort.

Agents tolerate a newer control plane, so there is no need to update every host before the control plane is confirmed good. Updating agents first only means rolling back more things if the control plane upgrade fails.