# Upgrade and migration guide

Upgrade DBAOps Sovereign by pulling the new release bundle and running schema migrations against your existing `SovereignRepository`.

## Steps

1. Stop services: `npm run stop:sovereign`
2. Back up `SovereignRepository` (full backup recommended)
3. Replace application files with the new bundle (preserve `.env` and `license/*.license`)
4. Run migrations: `npm run migrate`
5. Start services: `npm run start`
6. Verify: `npm run migrate:check` and `GET /api/health/ready`

## Notes

- Migrations are additive (v2–v29). v1 base schema runs only on greenfield installs.
- Cold-build proof: `npm run deploy:cold` validates greenfield; incremental migrate validates upgrades on your DB.
- Rollback: restore the pre-upgrade database backup; do not downgrade schema in place.
