Searchat — Backup & Restore Flow

Data Safety · Validation Gates · Atomic Operations
v0.6.0 | Last updated: 2026-02-17
Python 3.10+ · Parquet · FAISS · Atomic File Operations
Backup Creation Flow
1
User Initiates Backup
Triggered from Web UI or API endpoint
2
Generate Timestamp
Creates unique backup name: backup_YYYYMMDD_HHMMSS
3
Copy Data Directory
Copies conversations/*.parquet + indices/ to backup location
~/.searchat/backups/backup_YYYYMMDD_HHMMSS/
4
Copy Configuration
Backs up settings.toml, bookmarks.json, dashboards.json
5
Generate Metadata
Creates backup_metadata.json with:
• Timestamp • File count • Total size • Config hash
6
Backup Complete
Returns backup name and metadata to user
🔒 Safety Features • No deletion of active data
• Atomic directory copy
• Metadata validation
• Indefinite retention (manual cleanup)
Restore Flow
1
User Selects Backup
Chooses backup from list with timestamp + metadata
🛡️ Automatic Pre-Restore Backup System automatically creates backup of current state before restore:
backup_pre_restore_YYYYMMDD_HHMMSS/
Validation Gate #1: Backup Exists Checks if backup directory and metadata.json exist
❌ Validation Failed Return error: "Backup not found or corrupted"
Validation Gate #2: Structure Check Verifies presence of:
• data/ directory
• conversations/*.parquet files
• indices/embeddings.faiss
❌ Validation Failed Return error: "Invalid backup structure"
Validation Gate #3: Integrity Check Validates parquet file integrity + metadata consistency
❌ Validation Failed Return error: "Corrupted backup data"
2
Atomic Restore
Replaces active data/ with backup data/
Uses atomic directory swap operation
3
Restore Configuration
Restores settings.toml if included in backup
4
Reload Search Engine
Reinitializes search engine with restored data
5
Restore Complete
System now running with restored data
<5s
Backup Time
<10s
Restore Time
3
Validation Gates
Auto
Pre-Restore Backup