SQLite Forum

Hot backup database in WAL mode by coping
Ok, I was almost suspecting that this would be the case.

As far as I can tell its no big deal: Even if a write sneaks in between `PRAGMA wal_checkpoint(TRUNCATE)` and `BEGIN IMMEDIATE`, the database will be coherent as long as we save the database file and the `-wal`. The `-wal` will just not be 0 bytes/restarted really, but that is merely intended as an optimization step before the backup.