Back up and restore
At the end of this guide, a xixo deployment has a backup that has been restored at least once. The
commands assume the example compose file, with the web
service named xixo, the worker worker, and Postgres postgres.
What to back up
Section titled “What to back up”| What | Back it up | Why |
|---|---|---|
xixo_production |
Yes | The catalog: every item, note, tag, and connection, each analysis, every resource’s settings and encrypted credentials, and the vectors search uses. |
xixo_production_masks |
Yes, with the built-in masks | The built-in masks’ accounts, clients, and keys. With MASKS_ISSUER_TEMPLATE set, this database does not exist. Back up your masks server with masks instead. |
ENCRYPTION_PRIMARY_KEY, ENCRYPTION_DETERMINISTIC_KEY, ENCRYPTION_KEY_DERIVATION_SALT, and SECRET_KEY_BASE |
Yes, apart from the dumps | The first three decrypt the credentials in xixo_production. The built-in masks derives its keys from SECRET_KEY_BASE. A restore without them loses every stored credential. |
The files volume |
Yes | Uploads placed in the default storage, /data/files/xixo on xixo link beside the server. |
The storage volume |
Yes | Uploads that are still staged, waiting for a place. |
xixo_production_queue, xixo_production_cache, xixo_production_cable |
No | Jobs that have not run yet, and data rebuilt as xixo runs. Each resource syncs again at its next interval. |
| OpenSearch | No | Rebuilt from the catalog. See the search index. |
| Your other files | Your own way | The files stay in the resources they came from. Back up a folder, a bucket, or a mail server the way you already do. |
Back up
Section titled “Back up”-
Dump the catalog in Postgres’s custom format:
Terminal window docker compose exec -T postgres pg_dump -U postgres -Fc xixo_production > xixo-$(date +%F).dump -
Dump the built-in masks:
Terminal window docker compose exec -T postgres pg_dump -U postgres -Fc xixo_production_masks > masks-$(date +%F).dump -
Copy the staged uploads out of the
storagevolume:Terminal window docker compose exec -T xixo tar -czf - -C /rails storage > storage-$(date +%F).tar.gz -
Copy the placed uploads out of the
filesvolume:Terminal window docker compose exec -T link tar -czf - -C /data files > files-$(date +%F).tar.gz -
Keep every file somewhere the host does not hold, such as another machine or a bucket. Keep the keys in a password manager or a vault, apart from the dumps.
xixo keeps running during a backup. Each pg_dump reads one consistent snapshot of its database.
Restore
Section titled “Restore”-
Stop xixo and the worker, so nothing writes while the databases are replaced:
Terminal window docker compose stop xixo worker -
Replace the catalog. The new database must belong to the
xixorole, because row-level security is forced on the owner of every table:Terminal window docker compose exec -T postgres dropdb -U postgres xixo_productiondocker compose exec -T postgres createdb -U postgres -O xixo xixo_productiondocker compose exec -T postgres pg_restore -U postgres --exit-on-error -d xixo_production < xixo-2026-10-11.dump -
Replace the built-in masks the same way:
Terminal window docker compose exec -T postgres dropdb -U postgres xixo_production_masksdocker compose exec -T postgres createdb -U postgres -O xixo xixo_production_masksdocker compose exec -T postgres pg_restore -U postgres --exit-on-error -d xixo_production_masks < masks-2026-10-11.dump -
Put the staged uploads back:
Terminal window docker compose run --rm --no-deps -T --entrypoint "" xixo tar -xzf - -C /rails < storage-2026-10-11.tar.gz -
Put the placed uploads back:
Terminal window docker compose exec -T link tar -xzf - -C /data < files-2026-10-11.tar.gz -
Start xixo with the same keys the backup was made with:
Terminal window docker compose up -dThe web container migrates the databases on start, so a dump from an older release is brought up to date.
-
Check
/up, then open the catalog. See health check.
The search index
Section titled “The search index”OpenSearch holds nothing that the catalog does not. Every ten minutes, the recurring
rebuild_search_index job checks the index. When the index is missing or out of date, the job
builds a new one from the catalog, using the vectors stored in Postgres. No model embeds anything
again. Search answers from the old index, or answers nothing, until the new one is ready.
To rebuild now instead of waiting:
docker compose exec -T worker bin/rails runner RebuildSearchIndexJob.perform_nowCheck a backup
Section titled “Check a backup”Restore the catalog into a scratch database, compare its count of items with the real one, and drop it:
docker compose exec -T postgres createdb -U postgres -O xixo xixo_restore_checkdocker compose exec -T postgres pg_restore -U postgres --exit-on-error -d xixo_restore_check < xixo-2026-10-11.dumpdocker compose exec -T postgres psql -U postgres -d xixo_restore_check -c "SELECT count(*) FROM feeds"docker compose exec -T postgres psql -U postgres -d xixo_production -c "SELECT count(*) FROM feeds"docker compose exec -T postgres dropdb -U postgres xixo_restore_checkThe two counts match when the backup is whole, apart from what was added since it was made.