Currently, our app is using Room SQLite.

We need to let user to create application data backup, and export them as a single zip file.

Direct File Copy

I was wondering, is it safe, to perform direct File copy on application SQLite file to a temporary folder, for further zipping purpose? The reason I ask so is, I notice that sometimes the application database instead of appearing as single file like local-backup, it will have 2 additional files named local-backup-shm and local-backup-wal.

Read and Write to a temporary SQLite DB

Or, I should just create a temporary empty database, use Room to read application data and write to the temporary database? Then, zipping will be performed on the temporary database?

1 Answers

0
Gabe Sechan On

Copying the file is sufficient. That will copy the entire db.