Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back up the local data.mdb file #1192

Open
cxincx opened this issue Oct 6, 2024 · 1 comment
Open

Back up the local data.mdb file #1192

cxincx opened this issue Oct 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cxincx
Copy link

cxincx commented Oct 6, 2024

We need to back up the /objectbox/objectbox/data.mdb file, and we need to ensure that the database is complete and that the current data is not being written. We don't currently find an API that can be used.

Our current solution is to start a transaction and copy the database file in the transaction to avoid other writes during the copying process. Will it cause other problems?

sBoxStore.runInTx(new Runnable() {
        @Override
        public void run() {                
               use FileUtils copy data.mdb to backup_data.mdb
        }
    });
@cxincx cxincx added the enhancement New feature or request label Oct 6, 2024
@greenrobot
Copy link
Member

Might work, but no guarantees. The safe way is to entirely close the DB and do the backup then.

Our server versions have a "hot" backup ("enterprise") feature, which has several advantages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants