SQLite tricks
There are two ways of backing up a SQLite DB into a separate file while the app using the file is running. The first one works on most versions, the second one works on SQLite 3.27 and above.
sqlite3 /path/to/app.db ".backup '/pack/to/copy.db'"
# This one works with SQLite 3.27 and above.
sqlite3 /path/to/app.db "VACUUM INTO '/path/to/copy.db'"
To check that the copy was created properly, the SQLite CLI also supports the following.
sqlite3 /path/to/copy.db "PRAGMA integrity_check"