Export Project LFS Objects as part of GitLab Migration
What does this MR do and why?
Mentions #339405 (closed)
This MR adds export side of LFS Objects when using GitLab Group Migration that includes projects (https://docs.gitlab.com/ee/user/group/import/).
The export process is identical to what's happening in file based Import/Export lfs_saver.rb
For each LFS object:
- Export object itself
- Write it's
lfs_object_projects
reference to json, since a single LFS object can be references in multiple git repositories within a single project. E.g. when lfs object is used in project, wiki and design repositories
Import side of things will be done in the next MR after this is merged.
Screenshots or screen recordings
How to set up and validate locally
-
Feature.enable(:bulk_import)
. - Create new project and upload lfs objects to it
- Initiate project relations export using API
curl --request POST --header "PRIVATE-TOKEN: ..." http://gdk.test:3000/api/v4/projects/.../export_relations
- Wait until export is complete by ovserving
export_relations/status
endpoint - Download lfs objects compressed archive using
export_relations/download?relation=lfs_objects
endpoint and verify file contents. There should be lfs objects andlfs_objects.json
file present
curl --request GET --header "PRIVATE-TOKEN: ..." http://gdk.test:3000/api/v4/projects/.../export_relations/download\?relation\=lfs_objects --output /tmp/lfs_objects.tar.gz
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by George Koltsov