Backup & Restore
Export and import your organization's data for backup and migration.
Overview
The Backup feature allows admins to export a complete snapshot of their organization's data as a JSON file and restore it later. This is useful for data backup, migration between environments, and disaster recovery.
Key Concepts
Export Format
Backups are exported as structured JSON files containing:
- Metadata -- Export timestamp, tenant ID, tenant name, version, and export options
- Schema -- Enum definitions and data structure version for forward compatibility
- Master Data -- Referenced OEMs, equipment models, machine families, component catalog, machine positions, and work activities (only records used by the tenant)
- Tenant Data -- All tenant-scoped records including sites, profiles, vehicles, components, events, maintenance logs, meter readings, forecasts, work orders, parts, financial records, notifications, attachments, downtime events, fuel transactions, TCO scenarios, and settings
- Statistics -- Record counts per table for quick verification
Import Modes
| Mode | Behaviour |
|---|---|
| Merge | Matches existing records by name/ID and updates them. New records are inserted. Existing records not in the backup are left unchanged. |
| Replace | Deletes all existing tenant data first, then imports the backup. This is a destructive operation. |
Tenant Validation
Backups are validated against the current tenant:
- The backup's tenant ID must match the current tenant. You cannot import a backup from a different organization.
- Replace mode enforces the same-tenant requirement to prevent accidental data loss.
How to Use
Viewing Backup Statistics
Before exporting, you can view record counts for your tenant:
- Navigate to Admin > Backup.
- The stats panel shows counts for sites, profiles, vehicles, components, events, maintenance logs, meter readings, forecasts, work orders, parts, financial records, and audit logs.
Exporting Data
- Navigate to Admin > Backup.
- Configure export options:
- Include Audit Logs -- Include the full audit trail (can significantly increase file size)
- Include Deleted Records -- Include soft-deleted records (profiles, vehicles, work orders, parts)
- Click Export JSON.
- Save the downloaded file.
The export operation is audited, recording the export options and record counts.
Importing Data
- Navigate to Admin > Backup.
- Click Import.
- Select your backup JSON file.
- Choose the import mode (Merge or Replace).
- Review the import preview.
- Confirm the import.
Currently supported for import:
- Sites, profiles, vehicles
- Profile components and profile events
- Meter readings, parts
Exported but not currently imported:
- Maintenance logs, forecast events, work orders, financial records
- Notifications, attachments, downtime events, fuel transactions
- TCO scenarios
Master Data Requirements
Master data (OEMs, equipment models) is exported for reference but not imported automatically. Before importing a backup, ensure all referenced master data already exists in the target database. The import will fail with a descriptive error if profiles or vehicles reference non-existent OEM or model records.
To resolve foreign key errors:
- Check the error message for the missing OEM/model name.
- Create the missing master data records in Admin > Master Data.
- Retry the import.
Common Questions
Is there a size limit on exports?
The recommended maximum is approximately 50 MB. Very large tenants (over 100,000 records) may experience timeouts or memory issues. For production PostgreSQL backups, use pg_dump directly.
Can I import a backup from a different tenant?
No. The backup's tenant ID must match the current tenant. This prevents accidental cross-tenant data contamination.
What happens if the import fails?
Imports run inside a database transaction. If any step fails, the entire import is rolled back and no data is changed. The transaction has a 10-minute timeout for large imports.
Is SQL export supported?
No. The SQL export endpoint exists for backward compatibility but returns a "not supported" error. Use JSON export for all backup needs, or pg_dump for raw database dumps.
Are backups encrypted?
No. Backup JSON files are plain text. Handle them according to your organization's data security policies.