
Which SQLite files do you need when copying a Rust database?
When manually copying a Rust SQLite database, preserve the database with its matching side files from one stopped capture. For a running database, use a tool that takes a consistent SQLite backup.
Keep the database and its changes together
A matching -wal file can contain changes SQLite has already committed that are still missing from the main database. For example, a manual copy of player.blueprints.18.db that skips its existing player.blueprints.18.db-wal could miss recent blueprint unlocks. Your filename may have a different number. Combining the database from one backup with the -wal from another can corrupt the result.
A clean shutdown can leave no -wal file because SQLite put the changes into the main database and removed the side file. Use the files present after a known clean stop. The absence of a side file from a running copy calls for checking how the copy was made.
Make and check a working copy
If you can stop the writers, stop Rust cleanly and stop any separate service using that database. For a manual filesystem copy, copy the database and the side files that still exist, such as -wal, -shm or -journal, with their names unchanged. If the writers need to stay up, use a SQLite-aware backup tool or the plugin's documented export.
- Extract the database and its matching files into a new, empty folder. Keep the backup intact, since opening the database can change the working copy.
- Use your backup tool's database check if it has one, or run
PRAGMA integrity_checkin a SQLite tool on the working copy. The expected result isok. - Use a separate Rust instance or the plugin's test environment to check a known record from near the capture time. A readable database can still be missing the data you need.