Backup and restore
Raahi can export its complete configuration as JSON and import that file into another instance. Use this for backups, migrations, or configuration stored in version control.
Export without secrets
Section titled “Export without secrets”curl -fsS http://127.0.0.1:9080/api/v1/export \ -H "Authorization: Bearer $RAAHI_TOKEN" \ -o raahi-export.jsonThe default export omits private keys and other secret values.
Export a restorable copy
Section titled “Export a restorable copy”An admin can include secrets:
curl -fsS 'http://127.0.0.1:9080/api/v1/export?include_secrets=true' \ -H "Authorization: Bearer $RAAHI_TOKEN" \ -o raahi-export-secrets.jsonchmod 600 raahi-export-secrets.jsonThis file may contain TLS private keys, ACME account credentials, Cloudflare and EAB credentials, consumer secrets, and other sensitive values.
Import an export
Section titled “Import an export”curl -X POST http://127.0.0.1:9080/api/v1/import \ -H "Authorization: Bearer $RAAHI_TOKEN" \ -H 'content-type: application/json' \ --data-binary @raahi-export-secrets.jsonImport replaces the current routing configuration and assigns new database IDs where needed. Raahi commits the complete import in one transaction. If any part fails, it keeps the previous configuration.
Back up the database file
Section titled “Back up the database file”You can also use SQLite’s backup command or stop Raahi and copy the database. Do not copy only the main database file while Raahi is writing to it. Data may still be present in SQLite write-ahead log files.