You do need to ensure there's no SQLite3 process running that has your database open.
Code: Select all
cd /home/sqlite
sqlite3 sample.db .dump > sample.bak
Code: Select all
cd /home/sqlite
mv sample.db sample.db.old
sqlite3 sample.db < sample.bak
True enough. So a better way would be:DougieLawson wrote: ↑Wed Sep 25, 2019 11:02 pmYou do need to ensure there's no SQLite3 process running that has your database open.
Code: Select all
sqlite3 source.sdb ".backup 'destination.sdb'"
Thanks!DougieLawson wrote: ↑Wed Sep 25, 2019 11:02 pmYou do need to ensure there's no SQLite3 process running that has your database open.
With the sqlite3 command line program you can dump a database out as a bunch of SQL insert statements.
Dump:Restore:Code: Select all
cd /home/sqlite sqlite3 sample.db .dump > sample.bak
The restore could be done on any other machine with sqlite3 installed.Code: Select all
cd /home/sqlite mv sample.db sample.db.old sqlite3 sample.db < sample.bak