วันอาทิตย์ที่ 24 มกราคม พ.ศ. 2559

sqlite3 Backup database and Restore database



Backing up the database

To make a backup copy of the database, simply do a "dump" and redirect the results to a file.
cd /home/sqlite
sqlite3 sample.db .dump > sample.bak

Restoring the database

Restoring the database from a backup is just as easy as backing up, except we must make sure the destination database is empty first. Alternatively you may want to delete or rename the destination database and let sqlite create a new one for you.
cd /home/sqlite
mv sample.db sample.db.old
sqlite3 sample.db < sample.bak

ที่มา
http://www.ibiblio.org/elemental/howto/sqlite-backup.html