Upgrading and removing¶
This page explains how to upgrade the Bor server and the agents, what is preserved during an upgrade, how server and agent versions relate, and how to remove Bor completely, including what is left behind on the server and on managed desktops.
Before you upgrade¶
- Read the release notes of the new version on the GitHub releases page.
- Back up the database and the PKI directory
/var/lib/bor/pki. Database migrations run automatically when the new server starts and are not reversed by downgrading the package. See Backup and restore. - Upgrade the server first, then the agents.
Upgrade the server¶
- Download the new
bor-serverpackage and verify its checksum as described in Installing the server. -
Install it over the existing version:
-
Make sure the service is enabled and running the new version (see the warning below):
Debian, Ubuntu and RPM-based systems: the service may be stopped and disabled
The package's removal script, which also runs for the old version during
an upgrade, stops and disables the service. After upgrading on
Debian/Ubuntu or any RPM-based distribution, check
systemctl is-enabled bor-server and systemctl is-active bor-server,
and run sudo systemctl enable --now bor-server if needed. The same
applies to bor-agent (see below).
What happens during a server upgrade¶
- Configuration is preserved.
/etc/bor/server.yamlis a configuration file that the package manager never overwrites when you have modified it. On RPM systems a new default may be saved next to it asserver.yaml.rpmnew; Debian may ask whether to keep your version (keep it). Compare new defaults with your file by hand. - The installation script re-applies the ownership and permissions of
/etc/bor/server.yamland/var/lib/bor/{pki,acme}, re-applies thecap_net_bind_servicecapability to the new binary, reloads systemd and runssystemctl try-restart bor-server(restarts the service only if it is running). The JWT secret, admin password and database are not touched. - RPM upgrades may print a new "Initial admin credentials" banner. Ignore it: the password only replaces the commented placeholder that was already replaced on first install, and it is only ever used when the database contains no users. Existing accounts are unchanged.
- Database migrations run automatically the first time the new version
starts. Watch the log for
Failed to run database migrationsif the server does not come up. - The agent repository is updated together with the server. The new
package replaces
/usr/share/bor/agent-repowith the agent packages of the same release, and the server serves them immediately. Desktops get the new agent on their next package upgrade. - Certificates and the CA are kept. The files in
/var/lib/bor/pkiare created by the server, not shipped in the package, so an upgrade leaves them alone and enrolled agents keep working.
Upgrade the agents¶
Agents installed from the server-hosted repository are upgraded with the normal package tools of the desktop, from your own server:
Download the new package from https://bor.example.com/agent/apk/
(file names in /agent/manifest.json) and install it:
Then make sure the agent runs the new binary. The agent's installation script does not restart the service, and on Debian/Ubuntu and RPM-based systems the upgrade leaves it stopped and disabled:
Include both commands in whatever tool rolls out the upgrade (configuration management, unattended-upgrades hooks and similar).
What is preserved on the desktop:
/etc/bor/config.yaml(configuration file, never overwritten when modified).- The enrollment data in
/var/lib/bor/agent. Upgrading does not require re-enrollment. - All files the agent manages. On restart the agent receives a full snapshot and rewrites them as needed.
The agent version of each node is shown in the Agent column on the Nodes page.
Version compatibility¶
- A server hosts exactly one agent version: the one built with the same release. The Deploy agent wizard shows a warning if the hosted agent version differs from the server version (for example because the repository directory was modified).
- Upgrade the server first, then roll the agents forward. Already enrolled agents of the previous version keep connecting while you upgrade the fleet gradually, but upgrade them promptly so new policy types and settings are enforced.
-
If
apt updatefails withNO_PUBKEYor a signature error after a server upgrade, the repository signing key was rotated. Download the key again:
Remove an agent from a desktop¶
The agent does not clean up when its service stops or its package is removed: the policy files it wrote stay in place and stay in effect (they are just no longer protected against changes). Let the agent remove its policies first, then uninstall it.
- Withdraw all policies from the node. On Fleet -> Nodes, select the node and use Remove from group to remove it from every node group.
-
Let the agent apply the empty policy set. On the desktop, restart the agent so it reconnects with its new (empty) group membership:
Wait for
Received empty snapshot (no policies assigned). The agent then restores the original version of every file it replaced (it keeps a.bor-backupcopy before the first write) or deletes files it created, and removes Bor's package repositories, polkit rules, Flatpak remotes and similar. What happens to installed packages, Flatpak applications, firewall zones and LUKS keyslots is described on the individual policy type pages. -
Remove the package. The removal script stops and disables the service:
-
Delete the remaining files, including the agent's private key and the repository configuration added during installation:
sudo rm -rf /var/lib/bor/agent /etc/bor/config.yaml /etc/bor/flatpak /etc/bor/xdg sudo rm -f /etc/profile.d/99-bor.sh # repository definition, depending on the distribution: sudo rm -f /etc/apt/sources.list.d/bor.sources /etc/apt/keyrings/bor.asc # Debian/Ubuntu sudo rm -f /etc/yum.repos.d/bor.repo # RHEL/Fedora sudo zypper removerepo bor # SUSERemove
/etc/borif it is now empty. The CA certificate added to the system trust store (bor-ca.crt) can be removed as well; runupdate-ca-certificatesorupdate-ca-trustafterwards. -
Delete the node on Fleet -> Nodes. This revokes its certificate.
If the desktop is gone already
If the machine is decommissioned or unreachable, simply delete the node in the web UI. Deleting a node revokes its certificate, so a copy of the machine can no longer connect.
If you skipped step 2, managed files remain on the desktop. You can remove
them by hand using the list in
Files and ports:
for files the agent replaced, a .bor-backup file next to it holds the
original content (an empty backup means no original existed).
Remove the server¶
-
Stop and remove the package. The removal script stops and disables
bor-server.A modified
/etc/bor/server.yamlis saved as/etc/bor/server.yaml.rpmsave. -
Decide what to keep. Package removal leaves your data in place:
What Where Notes Database PostgreSQL database bor, roleborAll policies, nodes, users, audit logs, escrowed recovery keys. Internal CA and TLS certificate /var/lib/bor/pkiContains the CA private key. Without it, no enrolled agent can connect to a reinstalled server. ACME cache /var/lib/bor/acmeOnly used with ACME. Configuration /etc/bor/server.yaml(unless purged),/etc/bor/server.envContains the JWT secret and possibly the database password. Service account user and group borCreated by the package. Disk-encryption key file the path set in disk_encryption.escrow_kek_fileOnly if you configured recovery-key escrow. To reinstall later with the same data, keep the database and
/var/lib/bor/pki. -
Purge everything (irreversible):
sudo -u postgres psql -c 'DROP DATABASE bor;' sudo -u postgres psql -c 'DROP ROLE bor;' sudo rm -rf /var/lib/bor/pki /var/lib/bor/acme sudo rm -f /etc/bor/server.yaml /etc/bor/server.yaml.rpmsave /etc/bor/server.env sudo userdel bor sudo groupdel bor 2>/dev/null || trueRemove
/var/lib/borand/etc/borif they are empty. Remove PostgreSQL itself only if nothing else uses it.
Danger
Deleting /var/lib/bor/pki destroys the internal CA. Every enrolled
agent then has to be re-enrolled against a new server. Deleting the
database also deletes escrowed disk-encryption recovery keys. Export or
back up anything you still need first.