Backup and Recovery
SQLife provides connection backup and application-state recovery. A connection backup is an explicit JSON export; state recovery is an internal snapshot used after an abnormal shutdown.
Back Up Connections
- Open File -> Backup Connections.
- Choose a destination file.
- Keep the backup in a protected location.
The backup contains saved connection configurations, catalogs, properties, and saved credentials in SQLife's protected representation. Treat it as sensitive even when passwords are not saved.
Restore Connections
- Open File -> Restore Connections.
- Select a SQLife connection-backup JSON file.
- Read the confirmation dialog.
- Confirm the restore.
Restoring replaces the current saved connection set; it is not a merge. Back up the current set first if it must be preserved. Test restored connections and re-enter credentials when needed.
Application State Recovery
SQLife stores recoverable state in the SQLife data directory, normally as ~/.sqlife/state.dat on Unix-like systems or %USERPROFILE%\.sqlife\state.dat on Windows. The state contains information needed to restore the working session, such as open tabs and editor state.
State recovery is not a database backup. It does not guarantee recovery of uncommitted transactions, running queries, temporary result data, or files never written to disk. Commit or roll back database work explicitly and save important SQL files normally.
After an abnormal shutdown, SQLife may offer to restore the saved state during startup. Review recovered tabs and refresh data views before relying on their contents.
Pinning Tabs
Use the database-tab context menu to Pin or Unpin a tab. A pinned tab cannot be closed accidentally through the normal close action. Pinning is a tab-management feature, not a backup mechanism.
Good Practice
- Back up connections before changing or deleting many entries.
- Store backups with restricted permissions.
- Keep credentials out of shared repositories and tickets.
- Save important SQL files to normal files or version control.
- Test restored connection backups on a non-production workstation.
- Treat recovered data as a starting point and verify it against the database.