### Backup Database

The SQLite Database is a file based solution.
To make a backup, the simple way is:
• Ensure there is no active transaction when you copy or download the database file.
• Copy or Download the database file
• If used: Copy or download the journal files (wal and shm)
SQLite3 usage installed on a Raspberry Pi
If sqlite3 is installed, another option is outlined below.
IMPORTANT NOTE:
BE CAREFULL USING BELOW - make backup of the files first to go for sure, so that the data is available in case of an error.
Backup
cd /home/sqlite
sqlite3 sample.db .dump > sample.bak
OR
sqlite3 sample.db ".backup sample.db.bak"
Restore
cd /home/sqlite
mv sample.db sample.db.old
sqlite3 sample.db < sample.bak

Changed: , Category: SQLite, File: T6C254M1816.htm, ID: 1816