Hey Everyone, What is the suggested way for migrat...
# help
m
Hey Everyone, What is the suggested way for migration of data from one lakeFS installation to other? Looking forward to the answers 🙂
o
Hey @mishraprafful - That's a good question!
Are you looking to retain the same repositories? (i.e also transfer the data to different underlying storage?)
m
Hi @Oz Katz yes, we are looking at transferring all the repos to a different installation.
Maybe we can keep the underlying storage the same.
o
but you do plan on setting up a new PostgreSQL server?
m
yes, most probably that would change as well. We are planning to migrate PostGres and S3 (or keep them the same), what other points of failure do you think might affect this migration ?
o
I guess the safest option would then be to setup the second environment and migrate the repos one by one, for each repo: 1. on the old installation, run
lakectl refs-dump
(see reference): this writes all metadata related to the repository (commits, branches, tags) to the repository’s storage namespace 2. on the new installation - create a bare repository with the same name 3. copy the old repository’s storage namespace to the new one's location using e.g. rclone 4. run
lakectl refs-restore
(reference) to load back all commits, tags and branches 5. once it's all done, switch clients to the new repo. one note however, is that currently, refs-dump doesn't handle uncommitted records, so make sure to commit any staged writes prior to migration
another option (which is less recommended) is to dump the postgresql instance, load it into a new instance, copy all storage namespaces to new locations and manually edit the database to reflect the new storage location. this will preserve all the previous state, including uncommitted entries, users, groups, policies and even access credentials. it does require some manual intervention in the database so riskier. so make sure to also use the same auth.encrypt.secret_key and to run end to end sanity tests including reading, writing and committing data.
m
Thanks a lot for the suggestions @Oz Katz. I think we will go with the first one most probably.
o
Great! feel free to jump back here with any question..
m
Sure, thanks 🙂
👍 1