ObjectBox - Database Backup/Restore
Asked Answered
W

1

8

I have gone through the documentation and code for sample app, and figured out that files/objectbox/objectbox/data.mdb is the default file where all data is stored.

Assuming my understanding is correct, I have a couple of questions that I couldn't find documentation on:

  1. I want to have a backup/restore functionality in my Android app. Assuming I use native SQLite DB, I know I can upload the .sqlite file to cloud, and then download it on the same (or even a different) device to restore it. Can the same be done with data.mdb file?
  2. How about lock.mdb? Do I need to copy\upload it along with data.mdb?
Walking answered 9/9, 2017 at 19:42 Comment(0)
D
2
  1. Ensure that the file is not opened (e.g. by any BoxStore) to enforce a consistent state of the data.mdb file for backup.

  2. The lock.mdb file is not relevant for backups

Dishtowel answered 9/9, 2017 at 22:1 Comment(5)
Thanks for the response. I played around it with it while waiting for the response (which by he way pretty quick, thanks), and figured it out. Best.Walking
What is lock.mdf file? What is it's purpose? Why is it generated other than data.mdb file?Sidle
The lock.mdb file keeps track of internal stuff, e.g. coordinating "reader" resources. It does not contain application data.Dishtowel
how to open/read this .mdb file of objectbox?Ladew
ObjectBox databases can be viewed via the Admin web app: docs.objectbox.io/data-browserDishtowel

© 2022 - 2024 — McMap. All rights reserved.