The Import/Export feature allows users to save and restore their Heimdall SDR system state using structured .heimdall JSON files. This enables:
The .heimdall file is a JSON file with the following structure:
{
"metadata": {
"version": "1.0",
"created_at": "2025-10-31T15:30:00Z",
"creator": {
"username": "operator1",
"name": "John Doe"
},
"section_sizes": {
"settings": 256,
"sources": 2048,
"websdrs": 1536,
"sessions": 0,
"training_model": 0,
"inference_model": 0
},
"description": "Weekly backup - October 2025"
},
"sections": {
"settings": { ... },
"sources": [ ... ],
"websdrs": [ ... ],
"sessions": [ ... ],
"training_model": { ... },
"inference_model": { ... }
}
}
User preferences and application settings.
{
"theme": "light",
"default_frequency_mhz": 145.5,
"default_duration_seconds": 10.0,
"auto_approve_sessions": false
}
Known RF sources for training and localization.
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Test Beacon",
"description": "VHF beacon for testing",
"frequency_hz": 145500000,
"latitude": 45.5,
"longitude": 9.2,
"power_dbm": 10.0,
"source_type": "beacon",
"is_validated": true,
"error_margin_meters": 30.0,
"created_at": "2025-10-31T10:00:00Z",
"updated_at": "2025-10-31T10:00:00Z"
}
]
WebSDR receiver configurations.
[
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"name": "F5LEN Toulouse",
"url": "http://websdr.f5len.net:8901",
"location_description": "Toulouse, France",
"latitude": 43.5,
"longitude": 1.4,
"altitude_meters": 150.0,
"country": "France",
"operator": "F5LEN",
"is_active": true,
"timeout_seconds": 30,
"retry_count": 3,
"created_at": "2025-10-31T10:00:00Z",
"updated_at": "2025-10-31T10:00:00Z"
}
]
Recording session metadata.
[
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"known_source_id": "550e8400-e29b-41d4-a716-446655440000",
"session_name": "Training Session 1",
"session_start": "2025-10-31T10:00:00Z",
"session_end": "2025-10-31T10:10:00Z",
"duration_seconds": 600.0,
"celery_task_id": "task-123",
"status": "completed",
"approval_status": "approved",
"notes": "Good quality data",
"created_at": "2025-10-31T10:00:00Z",
"updated_at": "2025-10-31T10:15:00Z",
"measurements_count": 42
}
]
Get metadata about available data for export.
Response:
{
"sources_count": 10,
"websdrs_count": 7,
"sessions_count": 5,
"has_training_model": false,
"has_inference_model": false,
"estimated_sizes": {
"settings": 256,
"sources": 5000,
"websdrs": 2800,
"sessions": 3000,
"training_model": 0,
"inference_model": 0
}
}
Export selected data sections to .heimdall format.
Request:
{
"creator": {
"username": "operator1",
"name": "John Doe"
},
"description": "Weekly backup",
"include_settings": false,
"include_sources": true,
"include_websdrs": true,
"include_sessions": false,
"include_training_model": false,
"include_inference_model": false
}
Response:
{
"file": {
"metadata": { ... },
"sections": { ... }
},
"size_bytes": 8192
}
Import data from .heimdall file format.
Request:
{
"heimdall_file": {
"metadata": { ... },
"sections": { ... }
},
"import_settings": false,
"import_sources": true,
"import_websdrs": true,
"import_sessions": false,
"import_training_model": false,
"import_inference_model": false,
"overwrite_existing": false
}
Response:
{
"success": true,
"message": "Import completed successfully",
"imported_counts": {
"settings": 0,
"sources": 10,
"websdrs": 7,
"sessions": 0,
"training_model": 0,
"inference_model": 0
},
"errors": []
}
heimdall-export-YYYY-MM-DD.heimdall.heimdall file from your computercurl -X POST http://localhost:8001/api/import-export/export \
-H "Content-Type: application/json" \
-d '{
"creator": {
"username": "admin",
"name": "System Admin"
},
"description": "Automated backup",
"include_sources": true,
"include_websdrs": true
}' \
> backup-$(date +%Y%m%d).heimdall
curl -X POST http://localhost:8001/api/import-export/import \
-H "Content-Type: application/json" \
-d @import-request.json
Where import-request.json contains:
{
"heimdall_file": {
"metadata": { ... },
"sections": { ... }
},
"import_sources": true,
"import_websdrs": true,
"overwrite_existing": false
}
Export all data weekly for disaster recovery:
{
"include_settings": true,
"include_sources": true,
"include_websdrs": true,
"include_sessions": true
}
Share WebSDR configurations with team members:
{
"include_settings": false,
"include_sources": false,
"include_websdrs": true,
"include_sessions": false
}
Move to a new installation:
{
"include_settings": true,
"include_sources": true,
"include_websdrs": true,
"include_sessions": false
}
Share known RF sources:
{
"include_settings": false,
"include_sources": true,
"include_websdrs": false,
"include_sessions": false
}
Typical file sizes for different data volumes:
| Section | Items | Estimated Size |
|---|---|---|
| Settings | 1 | 256 bytes |
| Sources | 10 | ~5 KB |
| Sources | 100 | ~50 KB |
| WebSDRs | 7 | ~3 KB |
| WebSDRs | 20 | ~8 KB |
| Sessions | 10 | ~6 KB |
| Sessions | 100 | ~60 KB |
Complete export with 100 sources, 20 WebSDRs, 100 sessions: ~120 KB
Problem: “Username is required”
Problem: Export returns no data
Problem: Export is too large
Problem: “Invalid .heimdall file format”
Problem: Import partially succeeds
Problem: Overwrite not working as expected
Problem: Foreign key violations
All import operations use database transactions to ensure atomicity:
Import behavior with overwrite_existing:
| overwrite_existing | Existing ID | Behavior |
|---|---|---|
false |
Exists | Skip, continue |
false |
Not exists | Insert |
true |
Exists | Update |
true |
Not exists | Insert |
Imports validate:
Planned features (not yet implemented):
For issues or questions: