Skip to content

Upgrades and backups

For self-hosted installs. On the cloud we do both for you.

What to back up

Two things, kept apart:

  1. The database. Everything lives in PostgreSQL: incidents, schedules, people, settings.
  2. MASTER_ENCRYPTION_KEY, from .env (Docker Compose) or your secret store. It encrypts stored integration secrets. Without it, a restored database can't read them.

Keep the key with the backups but protected separately, so one leak doesn't give away both.

Back up

Docker Compose: one command

docker compose exec -T db pg_dump -U aiops_user aiops | gzip > neuroops-$(date +%F).sql.gz

aiops_user and aiops are the defaults; use POSTGRES_USER and POSTGRES_DB from .env if you changed them. Run it from the directory with docker-compose.yml.

Nightly, off the machine

scripts/backup/backup.sh takes a dump, checks it, optionally encrypts it, uploads it to S3-compatible storage (AWS S3, R2, B2, MinIO and others) and deletes dumps older than 35 days. It runs from another machine.

For a Docker Compose server, which has no database port open, it connects over SSH:

BACKUP_SSH=deploy@pager.example.com \
BACKUP_S3_BUCKET=my-neuroops-backups \
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_DEFAULT_REGION=eu-central-1 \
scripts/backup/backup.sh

For a database you can reach directly, set BACKUP_DATABASE_URL instead of BACKUP_SSH. The role needs to read every row (row-level security is on), so give it BYPASSRLS. Use client tools of the same PostgreSQL major version as the server.

Other settings, all optional:

Setting Default Meaning
BACKUP_KEEP_DAYS 35 Days of dumps to keep
BACKUP_S3_PREFIX neuroops/ Key prefix in the bucket
BACKUP_S3_ENDPOINT AWS Address of another S3-compatible store
BACKUP_ENCRYPTION_KEY_FILE none A file with a long passphrase; dumps are encrypted with AES-256 before upload
BACKUP_SSH_PATH neuroops The checkout on the server, relative to the SSH user's home
BACKUP_SSH_KEY_FILE none The SSH key to use

Run it every night from cron or a CI schedule.

Test a restore

A backup you have never restored is a guess. scripts/backup/restore-test.sh restores the newest dump into a scratch PostgreSQL server and checks it:

RESTORE_ADMIN_URL=postgres://postgres:...@scratch-host/postgres \
BACKUP_S3_BUCKET=my-neuroops-backups \
scripts/backup/restore-test.sh

Never point RESTORE_ADMIN_URL at production: the script creates and drops a database there.

Restore

Docker Compose, from a pg_dump file. Stop the backend, empty the database, load the dump, start again:

docker compose stop backend
docker compose exec -T db dropdb -U aiops_user aiops
docker compose exec -T db createdb -U aiops_user aiops
gunzip -c neuroops-2026-11-04.sql.gz | docker compose exec -T db psql -U aiops_user aiops
docker compose start backend

Keep the same MASTER_ENCRYPTION_KEY in .env. A dump from backup.sh is in PostgreSQL's custom format: load it with pg_restore instead of psql (and decrypt it first if you set BACKUP_ENCRYPTION_KEY_FILE).

Upgrade

  1. Take a backup.
  2. Read the release notes in CHANGELOG.md.
  3. Deploy the new version:
    • One-line installer, in its directory (./neuroops by default): docker compose pull && docker compose up -d. See Self-host upgrades.
    • Docker Compose, from the repository: git pull && docker compose up -d --build
    • Helm: helm upgrade neuroops oci://ghcr.io/neuroops/charts/neuroops -n neuroops --reuse-values
  4. Check that /readyz answers and that you can sign in.

Database migrations run when the backend starts, under a database lock, so with two servers only one runs them while the other waits. Migrations only go forward. To go back to an older version, restore the backup you took in step 1.

A license key set in LICENSE_KEY or LICENSE_FILE, or pasted on the License page, carries over an upgrade. See Install an Enterprise license.

More for production servers: Production deployment and Monitoring, retention and backups.