Finding Your Database
By default, toni stores its database at:If you specified a custom database path with
--db, use that path instead.Creating Backups
Simple File Copy
The easiest way to back up your data is to copy the SQLite file:Timestamped Backups
Create backups with timestamps for version control:toni.db.20260304_143022.
Automated Backups with Cron
Schedule daily backups:Using SQLite’s Backup Command
For more robust backups while toni is running, use SQLite’s.backup command:
Restoring from Backup
Full Restore
Replace the current database with a backup:Verify Integrity
Before restoring, verify the backup is not corrupted:Exporting Data
Export to SQL
Export the entire database as SQL statements:CREATE TABLE and INSERT statements.
Export to CSV
Export individual tables to CSV format:Export Visits
Export Visits
Export Restaurants
Export Restaurants
Export Want to Visit
Export Want to Visit
Export Joined Data
Export Joined Data
Export to JSON
Use SQLite’s JSON output mode (requires SQLite 3.33+):Importing Data
Import from SQL Dump
Restore from a SQL dump file:Import CSV Data
Import CSV files back into the database:Make sure the CSV file includes a header row matching the table column names.
Migration Considerations
Moving to a New Machine
Transfer your entire toni configuration:- Database (
toni.db) - Onboarding settings (
onboarding.json) - Yelp API key (
yelp_api_key) - UI preferences (
ui_prefs.json)
Schema Compatibility
If schema changes occur between versions, you may need to:- Export data from the old database
- Install the new version of toni
- Let it create a fresh database with the new schema
- Manually import your old data
Database Size Management
Compact the database to reclaim unused space:- 100 visits: ~50-100 KB
- 1,000 visits: ~500 KB - 1 MB
- 10,000 visits: ~5-10 MB
Syncing Across Devices
Using Cloud Storage
Store your database in a synced folder:Git-Based Sync
For version-controlled backups:Consider encrypting your repository if it contains sensitive restaurant notes or API keys.
Disaster Recovery
Corrupted Database
If toni reports database errors:Lost Database
If you’ve lost your database file:- Check for automatic backups in
~/.toni/backups/(if you set up cron) - Search for SQLite journal files:
~/.toni/toni.db-journal - Check cloud storage sync folders
- Restore from your most recent backup
Backup Best Practices
Recommended Strategy
Recommended Strategy
- Daily: Automated file copy to a backup directory
- Weekly: Manual verification and cloud storage sync
- Before upgrades: Full backup of
~/.toni/directory - Monthly: Archive to external storage or remote backup service
What to Back Up
What to Back Up
Essential files:
~/.toni/toni.db(main database)~/.toni/onboarding.json(settings)~/.toni/yelp_api_key(API key, if you want to preserve it)
~/.toni/ui_prefs.json(UI preferences like column visibility)
Retention Policy
Retention Policy
Suggested retention:
- Keep daily backups for 7 days
- Keep weekly backups for 1 month
- Keep monthly backups for 1 year
- Delete older backups to save space