---
title: "Updating"
description: "Upgrade Heptapod with the upgrade script, a fresh backup and a way back."
---

**Settings → Updates** shows whether a newer release exists. Upgrades run on the server with `scripts/upgrade.sh`. It backs up, upgrades and verifies in one step.

## Before you upgrade

1. Read the release notes for every version between yours and the target.
2. Copy a recent backup off the server; see [backups](/docs/running-it/backups/).
3. Plan for downtime. The script waits for running crawls to finish, which can take up to about 21 minutes.

## Upgrade

Check out the release you reviewed, then run the script from the checkout:

shell

```sh
cd "$HOME/heptapod"
git fetch --tags
git checkout <release-tag>
./scripts/upgrade.sh
```

The script puts the app into maintenance mode, stops the workers, creates an encrypted backup, pulls the new images, starts the stack and leaves maintenance mode only after every service is healthy. It never removes volumes.

If you build images from source instead of pulling them, run `./scripts/upgrade.sh --build`.

Caution

Do not force-kill workers to speed up the upgrade. That can leave unfinished jobs behind. Follow progress in a second terminal with `docker compose --env-file .env.prod logs --follow horizon`.

## When an upgrade fails

A failed step stops the script and leaves maintenance mode on. Read the error before you continue. Migrations can change the database, so going back to the old version can require restoring the backup the script made. Keep the old revision and its images until the new version runs well.

## After the upgrade

Sign in, open a site and run a check. Then preview the spread of scheduled checks and apply it:

shell

```sh
dc() { docker compose --env-file .env.prod "$@"; }
dc exec app php artisan heptapod:checks:rebalance-schedule --dry-run
dc exec app php artisan heptapod:checks:rebalance-schedule
```
