How to back up SQLite and verify the copy

By Anil Gautam · Published and reviewed September 20, 2026

Use a SQLite-aware backup operation when you need a copy you can restore. Exporting rows to CSV is useful for sharing data, but it leaves out the database structure and other objects. Choose the backup method based on what you’ll need to recover.

Use the SQLite shell backup command

In the official SQLite shell, open the source database and choose a new backup filename. Keep it separate from existing files:

sqlite3 app.sqlite
.backup app-backup.sqlite
.quit

The dot command runs in the SQLite shell, not in a generic SQL editor. See the SQLite shell documentation. Confirm the working directory and destination path before running it, and keep the resulting file somewhere separate from the original.

Alternatively, use VACUUM INTO

VACUUM INTO 'app-backup.sqlite';

This creates a new compact database copy. The destination must not already contain a populated database, and the operation has transaction and resource constraints described in the VACUUM reference. Run it with adequate disk space and let it finish before treating the file as a completed backup.

plainDB's Mac and Windows backup actions for SQLite use VACUUM INTO. There is no in-app SQLite restore action. An independent, documented backup procedure remains useful on either platform.

Validate a separate connection

Open the backup file, confirm its path with PRAGMA database_list;, then list its tables and inspect known rows. Use an integrity check when appropriate for your database size and workflow; passing an engine check does not prove application-level completeness.

Test recovery, not just file creation

Restore into an isolated test location using the application's documented process. Confirm that the application can open the database, read recent records and complete its usual workflows. Record the app version, database path, backup time and recovery steps alongside the backup.

For recurring backups, define retention and protect access to the files. A copied database can contain the same private data as the original. Keep multiple recoverable versions so a newly corrupted or accidentally emptied source does not become your only backup.

Continue reading

Handle live WAL databases · Check tables in the backup

For the desktop workflow, compare plainDB features on Mac and Windows or download the 14-day trial.