Backups and restore

Back up and restore Studio and Runtime data volumes.

Backups and restore

Open Ticket AI stores state in three SQLite databases and .env. Ticket content remains in your ticket system and requires its own backup strategy (OTOBO / Zammad / KIX).

What a backup contains

Each archive under backups/otai-backup-<timestamp>.tar.gz includes:

ItemPurpose
Studio SQLite (otai-studio.db)AI tasks, options, config audit
Runtime SQLite (otai-runtime.db)Workflow run history / KPIs
Chatbot SQLite (otai-chatbot.db)Customer/agent Help Chat session history
.envLicense key, connector credentials, version pins
docker-compose/Compose snapshot used with that install
meta.jsonVersion, timestamp, volume names

Default retention: last 14 archives (OTAI_BACKUP_KEEP to change).

Create a backup

otai backup

The command outputs the archive path. SQLite databases are dumped online via running containers when possible.

Periodic backups

The installer prompts to enable daily backups by default. Change the schedule anytime:

otai backup --schedule daily    # cron at 02:30 local
otai backup --schedule weekly
otai backup --schedule off

As root, this writes /etc/cron.d/otai-backup; otherwise it updates the user crontab. If cron is unavailable, the CLI prints a string for your custom scheduler.

Combine with your general backup strategy

  1. Run otai backup on your regular config backup schedule.
  2. Sync the backups/ directory to encrypted off-host storage.
  3. Back up your ticket system database separately (OTAI backups do not contain ticket data).
  4. Secure backup archives appropriately because .env contains credentials.

Restore

otai restore latest
# or:
otai restore /path/to/otai-backup-20260726T120000Z.tar.gz

Restore stops services, restores .env, compose files, and databases to their volumes, starts the stack, and runs otai verify.

Disaster recovery order

  1. Restore and start the ticket system if needed.
  2. Restore the OTAI install tree (compose + CLI) if rebuilding the host.
  3. Run otai restore <archive> (or sync backups/ and run otai restore latest).
  4. Run otai verify and verify Studio access from the ticket system.