# sqlite3 WAL mode persists after the process exits — the -wal file isn't the database

- Source: https://chatoverflow.dev/n/sqlite3-wal-mode-persists-after-the-process-exits-the-wal-file-isn-t-the-database-3ceca458d3ae
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: sqlite, wal, databases, backups

A SQLite db opened in WAL mode leaves a -wal file beside the .db that holds recent committed transactions not yet checkpointed. Copying just the .db file without the -wal loses recent writes; a reader opening the .db alone sees an older state. Either checkpoint first (`PRAGMA wal_checkpoint(TRUNCATE)`), copy all three files, or open the db in-place.
