How Backups Work
The system uses SQLite’s native backup API to create consistent database snapshots.Backup Location
Backups are stored in:Backup files are complete, standalone SQLite databases that can be opened independently.
Automated Daily Backups
The system automatically creates backups once per day:settings.jsonCreating Manual Backups
Create backups on-demand before major operations:backup() API for consistencysettings.json with timestampListing Available Backups
View all available backup files:Backup Information
Each backup shows:- name - Filename (e.g.,
backup_20260304_142305.db) - display - Friendly date/time (e.g., “04/03/2026 14:23”)
- size - File size in bytes
- path - Full file path
Using the Service
Restoring from Backup
¿Está seguro que desea restaurar este respaldo?
Backup: 04/03/2026 09:30
Advertencia: Esto sobrescribirá la base de datos actual.
Se creará una copia de seguridad de la BD actual antes de continuar.
tattoostudio.db.before_restore_20260304_143012Backup Configuration
Settings Storage
Backup metadata insettings.json:
Maximum Backups
The system keeps the 20 most recent backups. Configure inservices/backups.py:
Backup Best Practices
Before Major Changes
Always create a manual backup before:
- Database migrations
- Bulk data operations
- Software updates
- Schema changes
External Storage
Copy backups to external drives or cloud storage periodically for disaster recovery.
Test Restores
Periodically test restoring to a different location to verify backup integrity.
Document Restores
Keep a log of when and why you restore backups for audit purposes.
Backup Retention
Automatic Cleanup
When backups exceed MAX_BACKUPS:Manual Management
To preserve specific backups:- Copy them outside the
backups/directory - Rename them to prevent automatic deletion
- Store them with descriptive names:
Troubleshooting
Backup creation fails
Backup creation fails
Possible causes:
- Database is locked by another process
- Insufficient disk space
- Permission denied in backup directory
- Close other database connections
- Free up disk space
- Check folder permissions
Restore doesn't complete
Restore doesn't complete
Possible causes:
- Database file corrupted
- Application still running
- Insufficient permissions
- Verify backup file opens in SQLite
- Close application completely
- Run as administrator (if needed)
- Use the safety backup to recover
Last backup shows old date
Last backup shows old date
Possible causes:
- Application not running overnight
- Backup failed silently
- Timezone mismatch
- Create manual backup
- Check disk space
- Verify timezone settings
- Review error logs
Can't find backup files
Can't find backup files
Possible causes:
- Wrong directory
- Files deleted manually
- Database location changed
- Check
{database_directory}/backups/ - Search for
backup_*.dbfiles - Verify database path in settings
Technical Details
Backup Method
The system uses SQLite’sbackup() API:
- Consistent snapshot (no partial writes)
- Handles large databases efficiently
- Works while database is in use
- Native SQLite feature
Timezone Handling
All timestamps use:- Consistent date detection
- Accurate “today” checks
- Correct display times
Safety Backup Naming
Restore safety backups use:tattoostudio.db.before_restore_20260304_143012
This naming prevents conflicts and clearly identifies the safety backup’s purpose.