Upgrading & Downgrading
Crewship is a single binary plus acrewship-sidecar runtime that ships
alongside it. Upgrading swaps the binary; the database migrates itself on the
next start, behind an automatic snapshot. Rolling back a binary is one
step (self-update keeps a .bak), but once migrations have run, recovery
also requires restoring that pre-migration snapshot — see
Rollback / downgrade below.
Upgrade: crewship self-update
One command, whatever platform you’re on:
self-update picks the right mechanism from how crewship was installed:
| Install method | What self-update does |
|---|---|
Homebrew (brew install crewship-ai/tap/crewship) | Runs brew upgrade <formula> for you (crewship or crewship-cli, whichever you have). |
Installer / tarball (install.sh, or a downloaded archive) | Downloads the release asset for your OS/arch and build variant (full crewship vs crewship-cli), verifies its SHA-256 against checksums.txt, backs up the current binary to <binary>.bak, then atomically swaps the running binary in place — plus the bundled crewship-sidecar and entrypoint.sh when they sit alongside it. It re-runs the new binary’s version as a sanity check and rolls back from the backup if that fails. |
| System package / read-only path (apt, rpm, a container image) | Refuses to overwrite a file it doesn’t own, and prints the exact command to use instead (apt-get install --only-upgrade crewship, dnf upgrade crewship, docker pull …, or a reinstall via install.sh). |
<binary>.bak for a
manual rollback. self-update only acts when a newer release actually exists
— otherwise it reports you’re already current and exits.
The SHA-256 check confirms the download matches the published
checksums.txt;
it does not verify the file’s cosign signature. To verify provenance
end-to-end (Sigstore keyless signature), use install.sh with cosign
installed, or verify manually per the release notes.self-update needs a released binary. A development build (version = dev,
e.g. go run ./cmd/crewship) refuses — there’s nothing to compare against.Migrations run on the next start
self-update swaps the binary only. Schema migrations apply on the next
crewship start, and Crewship takes a pre-migration snapshot first
(<database>.pre-migrate-v<from>-to-v<to>-<timestamp>.bak, next to your DB).
So the upgrade flow is:
Rollback / downgrade
Migrations are forward-only. An older binary will refuse to start against a database a newer binary already migrated — with an error naming both versions — rather than silently corrupt data it doesn’t understand:- Reinstall the older binary. Homebrew:
brew install crewship-ai/tap/crewship@<version>(orbrew uninstall+ install the pinned tag). Installer:CREWSHIP_VERSION=vX.Y.Z curl -fsSL …/install.sh | bash. - Restore the matching pre-migration snapshot — the
*.pre-migrate-*.bakfile taken just before the upgrade you’re undoing. Stop crewship, replace the live database file with the snapshot, and start the older binary.
Related
- Migrations — the forward-only guard + pre-migration snapshots.
- Backup & restore — full backup bundles vs. the automatic migration snapshots.
crewship doctor— reports when a newer release is available.