Android Question Best Way for backup sqlite database

Binary01

Active Member
Licensed User
Longtime User
Hi,

I created my sqlite database app on my android device. I add new data with this app.
Now I want to make backup copy of this file to other storage location (SD Card, external storage, or computer or etc.).
How can I do?
Thanks
 

warwound

Expert
Licensed User
Longtime User
In theory you just close the database if it's open and copy the database file to your backup location.
Watch out though, SQLite sometimes uses additional temp files such as journal and wal files.

If either of these other temp files exist and you do not copy them along with the 'main' database file then your backup will likely be corrupt and useless.

Have a read:
https://www.google.co.uk/search?q=sqlite+journal+wal+files
 
Upvote 0
Top