Customer Docs
Backup & Restore
Customer-facing documentation for onboarding, deployment, storage providers, AI providers, and migration planning.
Backup & Restore
Status: PUBLISHED Last updated: 2026-05-01 Applies to: Self-host (cloud is fully managed)
What it does
Captures everything you need to recover an img-man instance after a disaster: the MongoDB metadata, the storage-bucket pointers (or the bucket contents themselves if you don't use BYOC), and the encryption key (KEK) that unlocks stored credentials.
When to use it
- Before upgrading between minor versions.
- Before changing the storage provider for an org.
- Disaster recovery drills (recommended quarterly).
- Migrating from one host / region to another.
What to back up
| Component | Where | Recovery point |
|---|---|---|
| MongoDB | Your Mongo Atlas cluster or self-hosted replica set | Hourly snapshots, 30-day retention |
| GCP / S3 bucket (managed storage only) | Your cloud provider | Versioning enabled is enough |
| KEK (encryption key for stored credentials) | A secret manager (GCP Secret Manager / AWS Secrets Manager / Vault) | Rotate using Credential rotation |
| Per-org BYOC credentials | Already encrypted at rest with the KEK; covered by the Mongo backup | — |
| Audit log | Already in MongoDB; covered by the Mongo backup | See Audit log for retention |
| Polotno license key (if using Polotno SDK) | Your .env / secret manager | — |
Step-by-step — Take a backup
- Snapshot MongoDB.
- Atlas: Project → Backups → Take snapshot.
- Self-hosted:
mongodump --uri "$MONGODB_URI" --gzip --archive=imageman-$(date +%F).gz.
- Verify bucket versioning. GCP:
gcloud storage buckets describe gs://your-bucket --format="value(versioning.enabled)". AWS:aws s3api get-bucket-versioning --bucket your-bucket. - Export the KEK to a sealed envelope in your secret manager. Do not check it into git, even encrypted.
- Generate a diagnostics bundle (see below) and store it alongside the snapshot.
Schedule the above weekly; for compliance modes (HIPAA, SOC 2 Type II) make it nightly.
Step-by-step — Restore
- Provision a new instance with matching
MONGODB_URI,KEK, andIMAGEMAN_BASE_URL. - Restore Mongo from the snapshot.
- Atlas: Backups → Restore → Select snapshot.
- Self-hosted:
mongorestore --uri "$MONGODB_URI" --gzip --archive=imageman-2026-04-12.gz --drop.
- Re-verify storage access. Open Settings → Storage → Test connection; the BYOC credentials decrypt with the KEK and the test should pass without any manual re-entry.
- Run the smoke test (see Verifying a restore below).
- Re-issue API keys for any clients whose key material was lost. Existing keys keep working as long as the Mongo restore included the keys collection.
Diagnostics bundle
/api/v1/admin/diagnostics (Pro+) returns a redacted ZIP with:
- Build version, Node version, OS.
- Mongo connection state, replica-set members, index stats.
- Storage provider, bucket region, signed-URL roundtrip.
- AI provider list and last-success timestamp per model.
- Last 1 000 audit entries (already redacted via credential redaction).
- Recent error stacks with secrets stripped.
Use it when you open a support ticket — it shaves hours off the back-and-forth.
Verifying a restore
Run this checklist after every restore:
- Sign in as an existing user.
- Browse a folder; thumbnails load.
- Generate a transform URL; the rendered image returns 200.
- Trigger a small AI edit; credits deduct correctly.
- Confirm a new audit entry appears with the restore action.
Related
Source: customer-docs/backup-restore.md