Skip to Content
Acclimate
Operate

Upgrade and recover

Upgrade a self-hosted deployment to a new Acclimate release, and roll back if the upgrade fails.

The service applies pending database migrations when it starts, and there is no downgrade. The way back is the copy of each database that you keep during the upgrade.

Pin an Acclimate release

Each release has a Git tag such as v0.1.0 and images for the service, the console, the executor and the runner tagged without the v, such as 0.1.0. ACCLIMATE_VERSION in .env selects the image tag. The default, local, builds the images from the checkout; record the commit you run. A release publishes no Keycloak image. Compose builds it from deploy/keycloak/Dockerfile, which pins its version, every time it starts the stack. See Versioning and compatibility.

You can skip releases, because the service applies every pending migration in order. Read the notes of each release you skip, and keep your applications' SDKs within one minor release of the service.

Upgrade

Read the new release's notes and note the tag or commit you run now. If you run learning, choose Pause on each running loop and wait for its active round to finish, because the same commands upgrade the executor.

Stop the proxy, the console, the service and Keycloak, and keep a copy of each database for an instant rollback. Without the co-hosted Keycloak, leave out keycloak and the keycloak-db line.

docker compose stop proxy console service keycloak
docker compose exec -T postgres createdb -U acclimate -T acclimate acclimate_pre_upgrade
docker compose exec -T keycloak-db createdb -U keycloak -T keycloak keycloak_pre_upgrade

Take a backup as in Bundled databases, then switch the checkout to the new release.

git fetch --tags
git switch --detach v<version>

With release images, edit the ACCLIMATE_VERSION line in .env to the new image tag, such as 0.2.0, then pull and start.

docker compose pull
docker compose up -d --wait

When you build from source, start with a build instead.

docker compose up -d --build --wait

Run the checks in Verify API access and sign-in, then start the learning loops again. Once you trust the upgrade, drop the copies.

docker compose exec -T postgres dropdb -U acclimate acclimate_pre_upgrade
docker compose exec -T keycloak-db dropdb -U keycloak keycloak_pre_upgrade

Do not delete the volumes

docker compose down keeps the volumes. docker compose down --volumes deletes them, and with them both databases and Caddy's certificates. Keep the same Compose project name, or the new containers get new, empty volumes.

Roll back an upgrade

A rollback discards newer data

A rollback returns each database to its copy from before the upgrade. Everything written after that is lost.

Stop the stack's writers and put the copies back.

docker compose stop proxy console service keycloak
docker compose exec -T postgres dropdb -U acclimate acclimate
docker compose exec -T postgres createdb -U acclimate -T acclimate_pre_upgrade acclimate
docker compose exec -T keycloak-db dropdb -U keycloak keycloak
docker compose exec -T keycloak-db createdb -U keycloak -T keycloak_pre_upgrade keycloak

Switch the checkout back with git switch --detach v<previous-version>, set ACCLIMATE_VERSION in .env back to the previous tag, and start as in Upgrade. The copies stay until you drop them, so you can repeat the rollback. Keep the provider encryption key you ran before the upgrade.

If you have dropped the copies, restore the backup you took during the upgrade instead.

On this page