
A SQLite database looks like an ordinary file, which makes a quick drag-and-drop backup feel obvious. The difficult question is what the application is doing while that copy happens. I would verify the backup method before trusting a copied file with the only record of important work.
The live-file problem
SQLite's corruption guidance warns that a background copy taken during a transaction can mix old and new content. Journal files also matter. Moving, deleting or separating a hot journal from its database can prevent recovery. A file ending in -wal or -journal is not automatically disposable clutter.
The official documentation lists SQLite-aware approaches for consistent copies, including the Online Backup API and VACUUM INTO. Which fits depends on the application and how it exposes maintenance operations. Prefer a supported backup feature when the application provides one rather than modifying its database behind its back.
Choose the method around the application
The Online Backup API copies the source into another database and supports incremental copying. SQLite explains that this avoids holding the source locked for the entire duration. VACUUM INTO can create a separate compacted copy of a live database. These are features for a correct implementation, not permission to experiment on a production file without preparation.
- Locate the actual database and identify the application using it.
- Check whether the application has a documented export or backup function.
- If maintaining the software yourself, select a SQLite-supported snapshot method and handle its errors.
- Write the backup to a separate destination, not over the source.
- Record when the backup finished and which application state it represents.
A backup is not proven until it can be used
I would restore into a separate test location, never over the working database as the first check. Open it with the expected application version, inspect representative recent records and confirm important relationships or attachments are available. A database copy may not include files stored outside the database.
For a small inventory tool, that check could include the latest item, a changed quantity and a record with an associated image. These are suggested acceptance checks, not evidence of a test performed here.
Do not repair by deleting sidecar files
If a copy fails to open, preserve the original files and error message. Do not delete the journal because an online comment says it is temporary. SQLite's own warning is the opposite: recovery information can be in those files.
The useful result is a consistent snapshot plus a successful, separate restore check. This article explains documented backup behavior, not a guarantee that a particular app's backup implementation is correct. For critical systems, test the supported procedure before an outage makes the choice urgent.
Sources and scope
Source-checked November 18, 2026. Original explanatory guide, not a hands-on test. Product behavior above is grounded in the official documentation linked below; workflow recommendations are editorial advice.
Comments
Post a Comment