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

Provide migration tool from v1 to v2 and viceversa #966

Closed
campoy opened this issue Aug 6, 2019 · 5 comments
Closed

Provide migration tool from v1 to v2 and viceversa #966

campoy opened this issue Aug 6, 2019 · 5 comments
Labels
area/tools Issues related to maintenance tools and CLI. kind/feature Something completely new we should consider. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate or work on it.
Milestone

Comments

@campoy
Copy link
Contributor

campoy commented Aug 6, 2019

As we are going to release the first data backward-incompatible changes we should also provide an easy way to transform a dataset from v1 to v2 and back.

This should be an easy task and it doesn't need to even be part of badger, it could be badger-migrate repository that imports badger at v1 and v2 and does the necessary transformations.

@campoy campoy added area/tools Issues related to maintenance tools and CLI. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate or work on it. kind/feature Something completely new we should consider. labels Aug 6, 2019
@campoy campoy added this to the v2.0.0 milestone Aug 6, 2019
@martinmr
Copy link
Contributor

martinmr commented Aug 6, 2019

I checked the code and the backups are written in the KV proto format so as long as that doesn't change, backups should work between versions. That proto has not changed since December 2018. I think we can close this for now.

@campoy
Copy link
Contributor Author

campoy commented Aug 6, 2019

Thanks for the update, @martinmr.

In that case I don't think this tool is that useful anymore, as one could migrate from one version to the other by following these steps:

  1. start with a dataset in vX and with the badger binary installed for the same version
  2. run badger backup --dir bak
  3. download the badger binary for vY
  4. run badger restore --dir -bak
  5. this will generate a new directory containing all the initial data in the new version

@campoy campoy closed this as completed Aug 6, 2019
@manishrjain
Copy link
Contributor

manishrjain commented Aug 6, 2019

Yes, doing a backup and then restoring should work. But, it would be slow and a lot more resource intensive. Instead, we can use the stream framework to read data from 1 and write it back using stream writer at the speed of disk, i.e. >200MBps -- that'd be much faster. Simple script like this can save many hours cumulatively for our users.

@ashish-goswami
Copy link
Contributor

I also made a change in commit 4e5cbcc, which changes backup file format(marshal entry list instead of single entry). Hence backups taken before this commit cannot be restored using current code.

@connorgorman
Copy link
Contributor

I think this issue is still relevant as @ashish-goswami has mentioned. However, I think a simple solution could be to write some magic and version at the beginning of the file (kind of like the manifest magic) and then branch off to choose the proper backup mechanism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tools Issues related to maintenance tools and CLI. kind/feature Something completely new we should consider. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate or work on it.
Development

No branches or pull requests

5 participants