# Upgrading

> Upgrade a Resta server by changing the image tag and redeploying. The API migrates Postgres on start; queries pause for a few seconds.

Source: https://resta.dev/docs/upgrading · Updated 2026-11-01

**To upgrade Resta, pull the new images and recreate the containers; the API migrates its Postgres tables on start, and database files need no migration because they stay in the SQLite format.** Queries fail for the few seconds the node takes to restart, so clients should retry.

## Docker Compose

```sh
docker compose pull
docker compose up -d
```

To upgrade deliberately, pin a version in `.env` and change it when you choose:

```dotenv
RESTA_VERSION=0.1.0
```

## Coolify

Change `RESTA_VERSION` in the resource's environment, or redeploy to pull `latest`.

## Before you upgrade

1. Read the release notes for the version.
2. Back up Postgres (see [Backups](https://resta.dev/docs/backups#back-up-postgres-too)).
3. Take snapshots of databases you cannot afford to lose since the last scheduled pass:

```sh
curl -X POST https://db.example.com/v1/databases/<name>/snapshots \
  -H "Authorization: Bearer $RESTA_API_KEY"
```

## During the upgrade

The node runs as one container on one volume, so it stops before the new one starts. Requests in that window fail with a connection error or `502` from the gateway. Open interactive transactions are rolled back.

## Rolling back

Set `RESTA_VERSION` to the previous version and redeploy. A Postgres migration from a newer version may not be readable by an older one; restore the Postgres backup from before the upgrade if the old API fails to start.
