SQLite
Configure SQLite databases for backup, both local files and remote via SSH.
Overview
SQLite is a file-based database. DBackup supports two modes:
| Mode | Description |
|---|---|
| Local | SQLite file on the same machine as DBackup |
| SSH | SQLite file on a remote server via SSH |
Configuration
SSH Credential Profile (SSH mode only)
SQLite in SSH mode requires an SSH_KEY Credential Profile. Create one in Settings → Vault → Credentials before saving the source. Local mode does not require a credential profile.
Local Mode
| Field | Description |
|---|---|
| Mode | Select "Local" |
| Path | Absolute path to .sqlite or .db file |
| SQLite Binary | Path to sqlite3 binary (default: sqlite3) |
SSH Mode
| Field | Description |
|---|---|
| Mode | Select "SSH" |
| Host | SSH server hostname |
| Port | SSH port (default: 22) |
| SSH Credential | SSH_KEY credential profile (username + key or password) |
| Path | Remote path to SQLite file |
| SQLite Binary | Remote path to sqlite3 binary |
Local Mode Setup
Docker Configuration
When running DBackup in Docker, mount the SQLite database:
services:
dbackup:
volumes:
- /path/to/app/data.db:/data/app.db:roThen configure the source with path /data/app.db.
Read-Only Mount
Use :ro for read-only access to prevent accidental modifications.
File Permissions
Ensure DBackup can read the file:
chmod 644 /path/to/database.dbSSH Mode Setup
- Create an
SSH_KEYcredential profile in Settings → Vault → Credentials (guide) - Select "SSH" mode
- Enter host and port
- Select the credential profile in the SSH Credential picker
- Enter the remote path to the SQLite file
Auth types in the credential profile
The SSH_KEY profile supports Password, Private Key (PEM), and SSH Agent. Configure the auth type when creating the profile.
Backup Process
DBackup uses the SQLite .dump command:
sqlite3 /path/to/database.db .dump > backup.sqlThis creates a text file with:
- Schema definitions (
CREATE TABLE) - Data as
INSERTstatements - Indexes and triggers
Backup Safety
The dump command is safe to run on a live database:
- Uses SQLite's built-in transaction handling
- Consistent snapshot of data
- No locking issues with WAL mode
SSH Remote Backup Flow
For SSH mode, the process is:
- Connect to remote server via SSH
- Execute
.dumpcommand remotely - Stream output back to DBackup
- Apply compression/encryption locally
- Upload to storage destination
This means:
- No large file transfers (streaming)
- Remote server needs
sqlite3installed - Bandwidth efficient
Remote File Browser
When configuring SSH mode, you can:
- Click "Browse" to open remote file browser
- Navigate the remote filesystem
- Select the SQLite database file
This helps find the correct path without manual entry.
Troubleshooting
File Not Found
Error: unable to open database fileSolutions:
- Verify the path is correct
- Check file permissions
- For Docker, ensure volume is mounted
SSH Connection Failed
Error: Connection refusedSolutions:
- Check SSH server is running
- Verify port number
- Check firewall rules
- Test with
ssh user@hostmanually
Permission Denied (SSH)
Error: Permission denied (publickey,password)Solutions:
- Verify credentials
- Check SSH key format (must be PEM/OpenSSH)
- Ensure user has shell access
sqlite3 Not Found
Error: sqlite3: command not foundSolutions:
- Install SQLite on the remote server
- Or specify full path in "SQLite Binary" field:
/usr/bin/sqlite3
Restore
Local Restore
- Go to Storage Explorer
- Find your backup file
- Click Restore
- Select target SQLite source
- Choose restore mode:
- Overwrite: Replace entire database
- Clean Slate: Delete file first, then restore
Path Remapping
You can restore to a different path:
- Enable "Remap Path" option
- Enter new destination path
- The backup will be restored to the new location
Best Practices
Use WAL mode for better concurrent access:
sqlPRAGMA journal_mode=WAL;Regular VACUUM before backup for smaller files:
sqlVACUUM;Mount read-only in Docker when possible
SSH key authentication is more secure than passwords
Test restore to verify backup integrity
Enable compression - SQLite dumps compress very well
Consider encryption for sensitive data