SQLite Backup API Versus Copying a Live File
Copying a database file while another process writes can produce an inconsistent backup. This guide gives you a small, testable way to approach the issue before changing a live system.
A practical workflow
- Use SQLite's online backup mechanism or a supported VACUUM INTO workflow for an active database.
- Restore the copy in isolation and run an integrity check plus one application-level read.
What to check
If WAL mode is active, treating the main file alone as the whole database is especially risky. Compare the result with the original problem and record what changed. If a measurement or test does not support the change, revisit the assumption rather than adding more complexity.
Keep the experiment small enough to reverse. Document the starting state, the change and the result so another person can repeat the process. Product menus and versions can change, so check the current documentation for your environment.
Official reference: Read the documentation.