SQLite Forum

Renaming a database
Login
A problem occurs if you use e.g. WAL mode and it actually uses 3 files per database. You can't rename them atomically. You could rename a parent directory.

Anyway, if you want to move "archived" records out of the way and always have a certain filename contain the latest data, it would be better to create the archive db, copy records into it and then delete them from the original once the copy completed. It's more work but no weirdness can ensue from renames.