Skip to content

Migrating between infrastructures

Every Keanan workspace can be packed into a single archive and restored anywhere the stack runs. This is the mechanism behind provider moves, backups and the promise that clients can leave whenever they like.

In the admin dashboard, open Settings, choose the Workspace tab and select Download export. The browser saves the complete archive, and the download is recorded in the audit trail. Only admin accounts can export.

The same archive is available on the server, which suits scheduled backups:

Terminal window
python manage.py export_tenant --output keanan_export.tar.gz

The archive contains data.json with every workspace record and a media directory with every uploaded file: receipts, slides, invoices and photos. Password hashes travel with the export, so people keep their logins.

On the target deployment, run migrations first, then import:

Terminal window
python manage.py migrate
python manage.py import_tenant /path/to/keanan_export.tar.gz

Existing rows with matching identifiers are overwritten, which makes the command safe to re run.

  1. Stand up the stack on the new infrastructure using the self hosting guide.
  2. Export on the old deployment and copy the archive across.
  3. Import on the new deployment.
  4. Point DNS at the new machine. Caddy issues a fresh certificate.

The whole exercise fits in an afternoon. Employees notice nothing except possibly a faster server.

Sessions and refresh tokens are excluded deliberately, so everyone signs in again after a move. Feature flag definitions live in Unleash and are recreated in its console, which usually means five flags and two minutes.