Appearance
Platform Backups
EaseLab runs automated platform-wide backups of the PostgreSQL platform database, all tenant databases, and file uploads. Operators configure storage, schedule, and retention from the admin portal.
Backup contents
Each backup run produces a manifest:
| Component | File | Description |
|---|---|---|
| Platform DB | platform.dump | Tenants, users, subscriptions, backup metadata |
| Tenant DBs | {slug}.dump per tenant | Full lab data |
| Uploads | uploads.tar.gz | Shared and per-tenant files |
Storage providers
| Provider | Configuration | Use case |
|---|---|---|
| Local | StoragePath on API server | Development, single-server deployments |
| S3 | Bucket, region, access keys | Production, off-site redundancy |
S3 settings
| Field | Description |
|---|---|
Bucket | S3 bucket name |
Region | AWS region (e.g. us-east-1) |
Prefix | Key prefix (default easelab-backups) |
AccessKeyId / SecretAccessKey | IAM credentials |
ServiceUrl | Optional — for MinIO or S3-compatible stores |
ForcePathStyle | Required for some S3-compatible endpoints |
When S3 is enabled, local staging files can be deleted after successful upload (DeleteLocalStagingAfterS3Upload).
Schedule and retention
Configure via Admin Portal → Backups → Settings or PUT /admin/backups/settings:
| Setting | Default | Description |
|---|---|---|
Enabled | true | Master switch |
IntervalHours | 1 | Scheduled backup frequency |
DefaultRetentionDays | 3 | Standard tenant backup retention |
GoldRetentionDays | 7 | Extended retention for priority tenants |
PlatformRetentionDays | 7 | Platform-level backup retention |
Manual backups can be triggered anytime with POST /admin/backups.
Backup run statuses
| Status | Meaning |
|---|---|
Pending | Queued |
Running | In progress |
Completed | Success |
Failed | Check error field |
Restoring | Restore in progress |
Stale Running backups older than 15 minutes are marked failed on API startup.
Restore scopes
| Scope | Value | Effect | Confirmation |
|---|---|---|---|
| Full platform | FullPlatform | Replaces platform DB + all tenant DBs + uploads | Type exact confirmation phrase |
| Single tenant | SingleTenant | Replaces one tenant's DB and uploads | tenantId + confirmation |
Platform restore: POST /admin/backups/{id}/restore
json
{
"scope": "SingleTenant",
"tenantId": "00000000-0000-0000-0000-000000000001",
"confirmation": "RESTORE"
}DANGER
Full platform restore is destructive. All current data is replaced. Perform only during maintenance windows with verified backup integrity.
Tenant-level backups
Tenant owners can list and restore their own backups (from platform backup manifests):
| Endpoint | Description |
|---|---|
GET /tenant/backups | List backups containing this tenant |
POST /tenant/backups/{id}/restore | Owner-only restore with data-loss acknowledgment |
PostgreSQL tools
The API server needs pg_dump and pg_restore available:
| Setting | Purpose |
|---|---|
PgDumpPath | Path to pg_dump binary |
PgRestorePath | Path to pg_restore binary |
PgBinDirectory | Optional bin directory (Windows) |