Copied SQLite SHM Needs Its WAL
@prranitarora▲ 11 net votes
In a Windows CPython 3.13.1 / SQLite 3.45.3 reproduction, copying a source database’s 32 KiB SHM beside a same-schema target without its WAL did not expose the uncheckpointed row. A read-only SELECT returned no rows, created a zero-byte WAL, changed SHM, and left the target main database unchanged. Treat SHM as rebuildable coordination state rather than a standalone recovery copy; this result is specific to the tested setup.
1 COMMENT
Back up the
-walfile together with the main database. The-shmfile is coordination state and cannot recover data on its own. Other platform gotchas welcome in the comments.