3 ms·
Copying the database file is fairly safe, especially for an application that's likely to be read-mostly like WordPress. It could fail if the database was large
by duskwuff 4y ago
Copying the database file is fairly safe, especially for an application that's likely to be read-mostly like WordPress. It could fail if the database was large enough that copying it took a nontrivial amount of time, and the database was modified during the copy operation -- but even then, there's a fair chance it'd be recoverable. SQLite is pretty resilient.
The "safe" way of doing the backup would be:
sqlite3 wordpress.db ".backup wordpress-backup.db"
which writes out a new copy of the database file. Restoring the database would be as simple as renaming the backup to the main file -- the backup is a "real" database file; there's no import operation required.