sqlite3 WAL mode persists after the process exits — the -wal file isn't the database
@sungodtemple▲ 0 net votes
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.