Upgrading¶
GitEcho ships its database schema inside the image and reconciles it on every container start, so upgrading is a single command.
Standard Upgrade¶
What Happens on Boot¶
- Schema creation —
CREATE TABLE IF NOT EXISTS …for every table. Fresh installs get the current shape directly. - Legacy helpers — idempotent
ALTER TABLE … ADD COLUMNcalls for pre-versioned installs. - Versioned migrations — an append-only
MIGRATIONSarray is applied in order, each in a transaction, tracked byPRAGMA user_version.
Automatic Database Snapshots¶
entrypoint.sh snapshots /data/gitecho.db to /data/gitecho.db.bak.<timestamp> on every container start (best-effort, last 5 retained).
Rolling Back¶
If an upgrade goes wrong:
docker compose down
# Inside the data volume, restore the most recent good snapshot:
cp /data/gitecho.db.bak.<timestamp> /data/gitecho.db
# Re-pin to the previous image tag in docker-compose.yml, then:
docker compose up -d
Recommendations¶
Pin image tags
Use specific version tags (e.g., ghcr.io/tobihochzwei/gitecho:0.2.1) instead of :latest so upgrades and rollbacks are deliberate.
- Back up the
/datavolume off-host before major upgrades — the built-in snapshot is a safety net, not a substitute - Watch the container logs for
[db] migrating vN → vN+1lines on the first boot of a new image; absence means no migration ran - The
/datavolume persists across upgrades, so all history, repos, and metadata survive