# Upgrades and backups

> Upgrading the registry, and the three things to back up.

Applies to: the Sypnia engine (open source, self-hosted).  
Source: https://skills.docs.sypnia.com/self-hosting/upgrades/

For agents: Upgrades: migrations on start, rolling restart, versions in checking resume; the CLI and the engine work one minor version apart. Back up: the signing key directory (losing it means re-signing every version under a new key and every project re-pinning), Postgres (records, reviews, tokens), storage packages/ (immutable; versioning on). Key rotation: skills keys rotate announces a new key signed by the old one, new versions signed with it; old signatures stay valid until the old key's end date.

Upgrades run the database migrations on start. Restart one instance at a time; versions that were being checked resume. The command line and the engine work together one minor version apart.

## What to back up

| What                                          | Why                                                                                                                      |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **The signing key** (`SYPNIA_SKILLS_KEY_DIR`) | your projects trust it. Losing it means signing every version again with a new key and every project pinning the new key |
| **Postgres**                                  | publishers, skills, versions, reviews, tokens                                                                            |
| **Storage** (`packages/`)                     | the packages themselves; they never change, so turn on versioning and keep a copy elsewhere                              |

## Rotating the signing key

```bash
docker exec registry sypnia-registry keys rotate --from 2027-01-01
```

The new key is published at `GET /keys`, signed by the old one, before it is used. The CLI accepts it because the old key vouches for it. Old signatures stay valid until the old key's end date.
