Backups
This repo uses a mix of centralized databases and service-specific artifacts. The backup strategy is therefore layered:
- Infrastructure-level backups (host + Docker volumes where appropriate)
- Central databases (PostgreSQL and Redis)
- Versioned configuration artifacts (JSON exports, templates)
Golden rule
If a piece of information must be recovered reliably, it must have exactly one canonical backup mechanism.
- If it is configuration-as-code, keep it in Git (templates, manifests, exports).
- If it is runtime state, back it up from the canonical datastore (usually Central PostgreSQL).
ThingsBoard
Analysis date: 2026-03-20
What to version in Git
Version functional artifacts under platform/thingsboard/exports/:
- dashboards
- profiles (device/asset)
- rule chains
- widgets / widget bundles
What to back up operationally
For a full instance clone/restore, back up the ThingsBoard database (Central PostgreSQL) plus deployment/customization files:
- DB dump:
docker exec postgres-central pg_dump \
-U "${POSTGRES_SUPERUSER:-postgres}" \
-d "${THINGSBOARD_DB_NAME:-thingsboard}" \
-Fc > thingsboard.dump - Customizations and runtime files:
platform/thingsboard/Dockerfileplatform/thingsboard/custom/platform/thingsboard/conf/platform/thingsboard/.env(generated)
Key risks
- JSON exports do not guarantee cross-dependencies (import order matters).
- DB-only restores do not capture custom JARs/templates.
n8n
Analysis date: 2026-03-20
What to version in Git
- Workflows and auxiliary artifacts under
infrastructure/n8n/export/ - Data tables under
infrastructure/n8n/export/datatables/ - Community nodes list under
infrastructure/n8n/n8n_data/nodes/package.json
What to back up operationally
- Encryption key (required to decrypt credentials):
infrastructure/n8n/n8n_data/config - Central PostgreSQL DB dump:
docker exec postgres-central pg_dump \
-U "${POSTGRES_SUPERUSER:-postgres}" \
-d "${N8N_DB_NAME:-n8n}" \
-Fc > n8n.dump
CLI export/import
Useful commands (run in the n8n container or a compatible environment):
n8n export:workflow --all --backup --output=/tmp/n8n-workflowsn8n export:credentials --all --output=/tmp/n8n-credentialsn8n export:entities --outputDir=/tmp/n8n-entitiesn8n import:workflow --separate --input=/tmp/n8n-workflowsn8n import:credentials --input=/tmp/n8n-credentialsn8n import:entities --inputDir=/tmp/n8n-entities
For cross-instance migration, ensure the
encryptionKeymatches, or export decrypted credentials with--decrypted.