Upgrading
Migrations are compiled into the binary and run at startup. They only move forward: once a newer version has opened the database, an older one may refuse to start or misread the schema, and nothing migrates back down.
So the order matters, and it is the same on every install:
- Back up
/var/lib/kaioand the binaries. - Upgrade.
- Check it came up.
Skipping step 1 is the only way to lose a stack history, and it is the step people skip.
1. Back up
Section titled “1. Back up”sudo sqlite3 /var/lib/kaio/kaio.db ".backup '/backups/kaio.db'"sudo tar czf /backups/kaio-$(date +%F).tar.gz -C /var/lib kaiosudo cp /usr/local/bin/kaio-server /usr/local/bin/kaio-cli /backups/The binaries are what lets you come back: the installer always fetches the latest release, so it cannot put an older one back.
Copying kaio.db alone while the server runs is not a backup: recent writes sit
in the -wal file until a checkpoint. Backup and restore explains
what that directory holds and why the three files travel together.
2. Upgrade
Section titled “2. Upgrade”Run the installer again, as root:
curl -fsSL https://kaio-labs.gaidot.net/install.sh | shIt fetches the latest release, keeps /etc/kaio/kaio.env, replaces both
binaries, which carry the dashboard with them, and restarts the service only if
it was already running. See Installation
for the layout it writes.
Coming from an install before 0.3.8, this run also moves your configuration from
/etc/kaio.env to /etc/kaio/kaio.env, unchanged, and leaves a symlink at the
old path. It touches nothing in /etc/kaio/monitoring either: the
monitoring stack you installed stays as you left it, and a file a
release changed and you had edited arrives beside yours as <name>.new rather
than over it.
3. Check it came up
Section titled “3. Check it came up”kaio-cli healthkaio-cli stack lshealth reports the version now answering, so it is the quickest confirmation
that the new binary is the one serving. stack ls confirms the migration found
your stacks.
In a cluster, upgrade the control plane last and check the registry afterwards:
a node running an older version still answers, and its reported version is
visible in kaio-cli node ls.
Your stacks are not part of the upgrade
Section titled “Your stacks are not part of the upgrade”The containers Kaio deployed are ordinary Compose projects owned by the Docker daemon, not by Kaio. Stopping, replacing and restarting Kaio leaves them running, and an upgrade never recreates them on its own. What a stack loses during the restart is the live view: metrics, the event stream, and any open log or shell session.
Going back
Section titled “Going back”There is no downgrade path for an applied migration, so returning to a previous version means restoring the state it knew:
- Put back the binaries you set aside:
sudo install -m 755 /backups/kaio-server /backups/kaio-cli /usr/local/bin/. - Restore the
/var/lib/kaiobackup taken before the upgrade. - Restart on both:
sudo systemctl restart kaio.
Step 1 takes the dashboard with it: the UI is compiled into kaio-server, so a
rollback cannot leave a newer page talking to an older API.
A backup taken after the upgrade carries the newer schema and will not help. That is the whole reason the backup comes before the upgrade.
Related
Section titled “Related”- Backup and restore
- Data retention, for what a restored backup is expected to have lost
- Deploy with Compose
- Installation
Kaio, built by Régis Gaidot