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

Sync and backup of database #52

Closed
omertuc opened this issue May 16, 2020 · 4 comments
Closed

Sync and backup of database #52

omertuc opened this issue May 16, 2020 · 4 comments

Comments

@omertuc
Copy link

omertuc commented May 16, 2020

The database directory contains several files:

image

I want to sync/backup the database across several machines, which of these files are important enough needs to be backed up for it to work? My current guess is that db should be enough, but the snap.* and conf also seem important. blobs is currently empty.

Could you please explain what these files are? And for future users - maybe add a README.md to that directory to help guide people who'll wonder the same.

@Ninjani
Copy link
Member

Ninjani commented May 16, 2020

The Way uses sled for database support. I skimmed sled's repo a bit and came to the conclusion that db and conf (which is the config file for the database) are the required files for backup. From what I could understand, blobs are for recovering data in a big database if it gets corrupted, and snap.* are snapshots to speed up the database initialization, so I don't think these are needed. I've asked this question over at their Discord to double check and I'll get back to you once they reply.

Good idea about adding a README; I'll do that after confirming that backing up works with these files, thanks!

@Ninjani
Copy link
Member

Ninjani commented May 19, 2020

Okay, got a reply from the sled maintainer and they say you need all the files for a valid backup. I hope that answers your question. I believe some aspects of sled are going to change in the 1.0 release so I think I would prefer to keep this directory as a black box for now. Similarly, if users would need to migrate to a backward-incompatible version of sled I think it would make more sense to run the-way export, the-way clear and the-way import instead of expecting users to have to deal with db migration themselves. What do you think?

@omertuc
Copy link
Author

omertuc commented May 20, 2020

Thank you for your effort.

I didn't realize there was the-way {export,clear,import}. That's great! I definitely agree users should rely on that rather than trying to sync the black-box database themselves. That's what I'll do from now on.

Great project by the way, up until now I've been sending my self Slack messages, but this is much nicer.

@Ninjani
Copy link
Member

Ninjani commented May 20, 2020

Thank you, that's great to hear! Let me know if you come up with possible enhancements / features for your workflow.

@Ninjani Ninjani closed this as completed May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants