Restore the latest production SQLite database backup to the local development environment
Restore the latest production SQLite database backup to the local development environment.
make dev) before running — SQLite locks the database file and replacing it under a running process will cause errors.Find the latest backup
/Users/ypeskov/Google Drive/My Drive/services/kkal-tracker/backups/.db.gz file (format: kkal_tracker_backup_YYYYMMDD_HHMMSS.db.gz). Sort by modification date (ls -t), not by nameCopy to project data directory
data/ in the project root:
cp "/Users/ypeskov/Google Drive/My Drive/services/kkal-tracker/backups/<latest>.db.gz" data/
Remove the current local database
rm -f data/app.db
Extract the backup
gunzip data/<latest>.db.gz
data/kkal_tracker_backup_YYYYMMDD_HHMMSS.dbRename to app.db
mv data/kkal_tracker_backup_*.db data/app.db
Verify
sqlite3 data/app.db "SELECT count(*) FROM users;"Run pending migrations
make migrate-up
| Parameter | Value |
|---|---|
| Backup location | /Users/ypeskov/Google Drive/My Drive/services/kkal-tracker/backups/ |
| Backup format | kkal_tracker_backup_YYYYMMDD_HHMMSS.db.gz (gzipped SQLite) |
| Local DB path | data/app.db |
| Database type | SQLite |