Skip to content

Add Automatic Database Backups #44

Description

@foxintheloop

Problem

No automatic backups exist. If the database becomes corrupted, all user data is lost.

Solution

Implement daily backup using SQLite's backup API (better-sqlite3 supports db.backup()):

  1. On app startup, check if last backup is >24 hours old
  2. Use db.backup(backupPath) to create incremental backup
  3. Keep last 3-5 backups in the app data directory, rotating old ones
  4. Add "Restore from Backup" option in Settings UI
  5. Show backup status in settings (last backup time, backup size)

Files

  • apps/electron/src/main/database.ts — add backup logic
  • apps/electron/src/main/settings.ts — store backup preferences
  • apps/electron/src/renderer/components/Settings.tsx — add restore UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions