# Updating How to update TREK to a newer version without losing data. ## Before You Update Back up your data first. Go to Admin Panel → **Backup** and create a manual backup, or copy your `./data` and `./uploads` directories to a safe location. See [Backups](Backups) for details. ## Image Tags | Tag | Example | Behavior | |---|---|---| | `latest` | `mauriceboe/trek:latest` | Always the newest release across all major versions | | Major version | `mauriceboe/trek:4` | Latest release pinned to that major version | | Minor version | `mauriceboe/trek:5.0` | Latest patch of that minor version; never moves to the next minor. Published from 5.0.0 on: 4.x releases have no minor tag, so pin those by major or full version | | Full version | `mauriceboe/trek:4.0.0` | Exact release; never changes | | Prerelease | `mauriceboe/trek:latest-pre` | The newest test build of the next version. For trying it out on a copy of your data, not for the instance you rely on | Use `latest` or a major-version tag if you want updates on each redeploy. A minor-version tag still brings fixes but waits for you to move to the next minor, which is where larger changes and database upgrades usually land. Use a full version tag for explicit control: update by changing the tag, not by re-pulling. ## Docker Compose (Recommended) **`latest` or major-version tag:** ```bash docker compose pull && docker compose up -d ``` This pulls the newest matching image and recreates the container with your existing volumes. Your data is untouched. **Pinned full-version tag:** Edit `docker-compose.yml`, update the tag in the `image:` line (e.g. `4.0.0` → `4.0.1`), then redeploy: ```bash docker compose up -d ``` ## Docker Run If you started TREK with `docker run`, pull the new image and replace the container: ```bash docker pull mauriceboe/trek docker rm -f trek docker run -d --name trek -p 3000:3000 \ -v ./data:/app/data \ -v ./uploads:/app/uploads \ -e ENCRYPTION_KEY= \ --restart unless-stopped \ mauriceboe/trek ``` > **Tip:** Not sure which volume paths you used? Check before removing: > ```bash > docker inspect trek --format '{{json .Mounts}}' > ``` ## Helm (Kubernetes) > **⚠️ Chart repository moved:** The Helm chart is no longer served at `https://mauriceboe.github.io/TREK` (the project moved from a personal repo to the `liketrek` organization). The canonical chart URL is now `https://chart.liketrek.com` — a custom domain (CNAME) for the GitHub Pages site at `https://liketrek.github.io/TREK`, so it stays stable even if the repository moves again. If your `trek` repo still points to an old URL, switch it before updating: > > ```bash > helm repo remove trek > helm repo add trek https://chart.liketrek.com > ``` > > You can check which URL you have configured with `helm repo list`. Existing releases are unaffected — only the repo URL changes. To update to the newest chart release: ```bash helm repo update helm upgrade trek trek/trek ``` Your existing values and PVCs (data, uploads) are preserved. To pin an exact chart version instead, pass `--version `. See [Install-Helm](Install-Helm) for the full installation walkthrough and values reference. ## Database Migrations TREK runs any pending database migrations automatically at startup. No manual migration steps are required after pulling a new image. Migrations only go forward, so going back to an older image means going back to a copy of the database from before the update. Images from 5.0 on refuse to start on a database a newer TREK has migrated. Images from 4.3.x and earlier do not check this: they start on the newer database without a warning, so restore the copy before you start one of them. TREK takes that copy itself. Right before a startup applies pending migrations, it writes the database to `data/pre-migrate--