Upgrading

GitBlixt upgrades are designed to be safe and fast. Database migrations run automatically on startup.

Standard Upgrade

    docker compose pull
docker compose up -d

Compose pulls the latest image and recreates only the gitblixt container. The database container stays running. Migrations run automatically on startup.

Upgrading to a Specific Version

Set the version in your .env or override the image directly:

GITBLIXT_IMAGE=willc0de4food/gitblixt:1.2.0 docker compose up -d

Before Upgrading

  1. Read the release notes for the version you're upgrading to — especially any breaking changes or manual migration steps.
  2. Take a backup before every upgrade. See Backup & Restore.

Rollback

If something goes wrong after an upgrade:

  1. Stop the current container
  2. Start the previous image version (you'll need the old image tag)
  3. Restore your database from the pre-upgrade backup

Upgrading the Bundled Postgres (major version)

New installs run Postgres 18. A major version bump (e.g. 16 → 18) is NOT a plain docker compose pull — Postgres refuses to start on a data directory created by an older major version. You must dump on the old version and restore into a fresh new one. (Minor updates within the same major are safe.)

Take a backup first, then, on the host where GitBlixt is installed:

    cd /opt/gitblixt

# 1. stop the app so it releases DB connections
docker service scale gitblixt=0

# 2. dump using the OLD postgres container's own pg_dump (version-matched, clean)
PG=$(docker ps -q -f name=postgres)
docker exec "$PG" pg_dump -U gitblixt -Fc gitblixt > /opt/gitblixt/pg-upgrade.dump

# 3. remove the old postgres container and set its data dir aside (don't delete yet)
docker compose -p gitblixt rm -sf postgres
sudo mv /opt/gitblixt/data/postgres /opt/gitblixt/data/postgres-old.bak

# 4. start the new postgres (version comes from docker-compose.yml) — fresh init
docker compose -p gitblixt up -d postgres
sleep 5

# 5. restore into the fresh database
PG=$(docker ps -q -f name=postgres)
cat /opt/gitblixt/pg-upgrade.dump | docker exec -i "$PG" pg_restore -U gitblixt -d gitblixt

# 6. bring the app back (migrations run on boot)
docker service scale gitblixt=1
docker service ps gitblixt

Verify the app works on the new version, then clean up: shred -u /opt/gitblixt/pg-upgrade.dump and sudo rm -rf /opt/gitblixt/data/postgres-old.bak. Keep the .bak until you're confident — it's your rollback.