> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sitecopilot.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker upgrade

id: docker-upgrade

title: Docker Upgrade

Upgrade strategy for Docker deployments. Follow a backup → upgrade → smoke test workflow.

## Step 0 — Backup first

* Backup MySQL: `docker exec mysql sh -c 'exec mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD" > /tmp/all.sql'` then `docker cp` to host or stream to object storage.

* Backup uploads volume (rsync or tar).

## Step 1 — Pull new image

```bash theme={null}

docker compose pull sitecopilot

```

## Step 2 — Run migrations & restart

Some images run migrations on startup. Use rolling restart:

```bash theme={null}

docker compose up -d sitecopilot

# or for zero-downtime if you run multiple replicas behind a proxy

docker compose up -d --scale sitecopilot=2 sitecopilot

```

## Step 3 — Smoke tests

* Check logs: `docker compose logs sitecopilot` for migration success.

* Call health endpoint (if available): `curl -I https://docs.example.com/health`.

* Browse the admin UI and a few pages.

## Rollback

* If upgrade fails, stop new container and start the previous image tag:

```bash theme={null}

docker compose pull sitecopilot:previous-tag

docker compose up -d

# restore DB from dump if necessary

```
