Skip to content

Tenant Backups

EaseLab provides tenant-scoped database backups so laboratories can protect their data, meet retention policies, and recover from operational mistakes. Platform-wide backups are managed separately in Platform Backups.

Screen: /admin/backups
Permission: backups.view (manual trigger requires backups.create)

Backup architecture

mermaid
flowchart TB
    subgraph Tenant Portal
        UI[Admin Backups UI]
    end
    subgraph API
        TB[TenantBackupsController]
        BS[BackupService]
    end
    subgraph Storage
        LOC[Local storage]
        S3[S3-compatible storage]
    end
    UI --> TB --> BS
    BS --> LOC
    BS --> S3
    BS --> PG[(PostgreSQL pg_dump)]

Each backup run captures:

ComponentContent
Tenant databaseFull PostgreSQL dump of lab data
Uploads archiveTenant-scoped files (logos, attachments)
ManifestMetadata, retention flags, plan context

Backup types

TypeTriggerInitiator
ManualOn-demandLab admin via UI
ScheduledCron / background servicePlatform configuration

Scheduled backups respect platform BackupSettings — enabled flag, interval, retention days, and storage provider.

Running a manual backup

  1. Open Admin → Backups.
  2. Review last successful run and storage location.
  3. Click Run Backup (backups.create).
  4. Monitor status: Pending → Running → Completed.
  5. Download manifest or verify size when completed.

Before major changes

Always run a manual backup before bulk catalog imports, fiscal year rollover, or restore drills.

Backup run statuses

StatusMeaning
PendingQueued
RunningDump in progress
CompletedSafe to restore
FailedSee error message; retry after fixing cause
RestoringRestore operation active — avoid concurrent writes

Interrupted runs may be recovered automatically on next service start.

Storage providers

Platform configuration selects storage:

ProviderUse case
LocalDevelopment, single-server deployments
S3Production — durable off-site copies

S3 settings include bucket, region, prefix, and optional custom endpoint for MinIO-compatible stores.

Listing and retention

The backups list shows:

  • Run ID and timestamp
  • Type (manual / scheduled)
  • Size and duration
  • Storage path
  • Retention eligibility

Retention policy may mark old tenant copies as non-restorable (Retained = false in manifest). Plan slugs can influence retention tiers.

Retention is not unlimited

Confirm your plan's retention window. Expired backups are removed from restorable manifests.

Restore operations

Tenant admins can restore their own data from eligible backups:

mermaid
flowchart TD
    A[Select backup run] --> B{Confirm destructive action}
    B --> C[Stop writes / notify staff]
    C --> D[Restore tenant DB]
    D --> E[Restore uploads archive]
    E --> F[Verify sample invoices]
ScopeDescription
Single tenantRestores one laboratory database and uploads
Full platformPlatform admin only — all tenants

Restore requires explicit confirmation. All current data since the backup point will be lost.

Post-restore verification

CheckPass criteria
LoginStaff accounts authenticate
Latest invoiceExpected data present or correctly rolled back
CatalogTest count matches expectation
UploadsLogo and report assets load
Analyzer keysDevices still registered

Permissions

ActionPermission
View backup listbackups.view
Trigger manual backupbackups.create
RestoreTypically admin + platform policy
Delete backup artifactPlatform admin

Tenant UI does not grant edit/delete on backup rows — immutability protects audit trail.

PostgreSQL tooling

Backups use pg_dump / pg_restore with configurable binary paths:

  • PgDumpPath / PgRestorePath
  • PgBinDirectory for non-standard installs

Contact EaseLab support if restore fails or backups do not appear in the list.

Security

ControlDetail
Tenant isolationBackups contain only requesting tenant data
Encrypted transitS3 HTTPS
Access controlbackups.view minimum
Locked tenantsBackup may still run; verify billing status

Troubleshooting

IssueResolution
Backup stuck RunningCheck API logs; recovery service resets interrupted runs
Failed — disk fullFree space or switch to S3
Failed — pg_dump missingInstall PostgreSQL client tools
Restore 403Insufficient permission or backup expired
Slow backupLarge database — schedule off-peak

Ease Lab — Cloud Pathology Lab Management