> Backup or restore while a transaction is active
Is there any information whether taking a consistent snapshot (that contains both the DB file and journals) is safe?
Is there any information whether taking a consistent snapshot (that contains both the DB file and journals) is safe?
If you copy while transactions are ongoing, you're reading different parts of a file at different points in time. For example, the beginning of the sqlite3 has already been copied, but by the time you get to the log file, blocks have been committed back into the beginning of the sqlite file.
If you take a consistent snapshot of the filesystem first, I would think that would be the same as a crash in the middle of a transaction. Things should be in a consistent state that the recovery code at startup can handle.