Upgrades and rollback
Until 1.0, read the release notes of every version you upgrade to: a minor version can still change defaults and the configuration, and this page lists the changes that need action from you.
Upgrade
Read the release notes for migrations and changed defaults.
Take a backup and verify it:
shharbor-pilot backup --config /etc/harbor-pilot/config.yaml --out /srv/backups/pre-upgrade harbor-pilot backup verify /srv/backups/pre-upgradeReplace the binary, or pull the new image, and restart.
At startup the server applies pending database migrations in order, each in its own transaction. Before the first one it writes a copy of the database, harbor.db.pre-<version>.bak, next to it. The log shows db.migration.backup and one db.migration.applied line per migration. If a migration fails, the server refuses to start and the database stays as it was before that migration.
Then check:
harbor-pilot doctor --config … --server https://pilot.example.compasses;/readyzreturns 200;- Settings → System & backups → This instance shows the new Version, and Database schema versions the schema version of the main and captured content databases.
With Docker, pin a version tag rather than latest, so an upgrade is a deliberate change. 0.1 takes patch releases of 0.1; moving to 0.2 is an upgrade to read the notes for. Change the tag in your Compose file, then:
docker compose pull && docker compose up -dRoll back
An older binary refuses to run against a database it doesn't know:
database has migration 20261105201500000 unknown to this binary; refusing to run an older version against a newer schemaChoose the path that matches the upgrade:
The upgrade applied no migrations: stop the server, reinstall the previous binary (or pin the previous image tag), and start it.
The upgrade applied migrations: stop the server and restore the backup from step 2:
shharbor-pilot restore --from /srv/backups/pre-upgrade --config /etc/harbor-pilot/config.yaml --yesThen start the previous binary. Changes made after the upgrade are lost, so use the newest backup taken before it. The automatic
harbor.db.pre-<version>.bakworks too: move it into place asharbor.dbwhile the server is stopped.
See Backup and restore.
Notes for specific versions
0.1.7
- No migrations. One new configuration key,
gateway.usage_headers(HP_GATEWAY_USAGE_HEADERS), defaultoff, which leaves responses unchanged. - Usage in Claude Code (D-048). Set
gateway.usage_headers: auto(see Configuration) to report usage in the headers Claude Code shows in/usageand its status line. Claude Code reads them only when its users pass the gateway token asCLAUDE_CODE_OAUTH_TOKEN; see Claude Code. oauth-…beta flags are dropped. Theoauth-…flag inanthropic-betais no longer forwarded to Anthropic upstreams; other flags pass as before.- Bridge effort. The Claude Code bridge now passes a request's top-level
output_config.effortto the CLI as--effort. - Reasoning option per model (D-047). A model can carry a
reasoningoption that translates Claude Code's adaptive thinking and effort, and other clients' reasoning settings, for its upstream; see Providers. Models without it send the same upstream bodies as before. Only the wording of some recorded losses changed (context_management,thinkingandoutput_configdrops now say why). - Writing providers through the API or Terraform. As with the request fields, a provider update that leaves
reasoningout of a model clears it. - New losses on Claude Code bridge requests. The bridge now records the client's thinking mode (
thinking, approximate: the CLI chooses its own) and a top-leveloutput_config.format(dropped). Requests are sent as before; alerts or reports that count losses will see them.
0.1.6
- No migrations, no new configuration keys.
- Upstream request fields (D-046). A provider's models can pin the upstream provider (OpenAI-compatible providers only) and set allowlisted request fields; see Providers. Models that configure nothing are unchanged.
- Writing providers through the API or Terraform. Updating a provider replaces its whole spec, so a client that leaves out
provider_routing,request_fieldsorrequest_field_policyclears values set in the UI. Add them to the resource'sspecbefore applying.
0.1.5
- No migrations.
- Bridge sessions may stay on disk longer (D-045). When a Claude Code bridge process ends between turns, its CLI session is kept for up to the conversation's prompt-cache TTL (5 minutes or 1 hour) after its last use, so the next turn can resume it. Before, conversation files were removed when the process ended. Kept sessions are deleted at expiry, on account removal and at shutdown, and are bounded by the new keys
bridges.claude_code.shelf_max_per_account(default16) andbridges.claude_code.shelf_max_bytes(default 256 MiB); a value of0means the default, and there is no switch to turn retention off. See Limitations. - Behaviour changes. The Claude Code bridge removes client
cache_controlmarkers (recorded as acache_controlloss), a 400 reported by the CLI is returned to the client instead of failing over, and attempts are numbered in the order they ran (skipped candidates are listed as excluded instead). Review alerts or scripts that count failovers or read attempt numbers.
0.1.4
- One migration.
20261108100000000_add_budget_state_limitsadds two nullable limit columns tobudget_state. It is quick and needs no action; the server writesharbor.db.pre-<version>.bakbefore applying it, so rolling back means restoring a backup. - One repeated budget alert. A budget that already sent
budget.threshold.warningorbudget.threshold.exceededin its current period sends it once more after the upgrade. Alerts now re-arm when a budget's limit is raised, and budgets upgraded mid-period have no recorded limit yet, which counts as raised.
0.1.2
- Budget refusals are now policy blocks. A request that blocking budgets refuse is recorded as Blocked and sends
access.request.blockedfor every refused request, with the budget inreason; 0.1.1 recorded it as an error without the event. Review alert rules, webhooks and Pulse consumers that subscribe toaccess.request.blocked.budget.threshold.exceededis still sent once per period. - The first start indexes existing request history by trusted reference (for
ref=filters andgroup_by=ref:<key>). This runs as one migration before the server listens, and its time and disk use grow with requests and ledger rows times their references. As a guide, 1M requests plus 1M ledger rows with 3 references each took about 27 s and added about 530 MB. Make sure the disk has room for that, the database and theharbor.db.pre-<version>.bakcopy.
0.1.1
The first release: there is nothing to upgrade from. (0.1.0 was tagged but never published.)
Rotating the master key
Rotation is independent of upgrades, but has the same care around backups:
- Generate a new key:
harbor-pilot keys generate > /etc/harbor-pilot/master-2.keyandchmod 600it. - Point
security.master_key_fileat the new key and add the old one tosecurity.previous_master_key_files. - Restart. New secrets are sealed with the new key; old ones still open with the old key.
- Run
harbor-pilot keys rotate --config …to re-wrap every stored key under the new one. - Keep the old key in
previous_master_key_filesuntil you no longer need any backup taken before the rotation (a restore checks for it). Then remove it and restart.
Details in Secrets and the master key.