Skip to content

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:

  1. Export object itself
  2. 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

image

How to set up and validate locally

  1. Feature.enable(:bulk_import).
  2. Create new project and upload lfs objects to it
  3. Initiate project relations export using API
curl --request POST --header "PRIVATE-TOKEN: ..."  http://gdk.test:3000/api/v4/projects/.../export_relations
  1. Wait until export is complete by ovserving export_relations/status endpoint
  2. Download lfs objects compressed archive using export_relations/download?relation=lfs_objects endpoint and verify file contents. There should be lfs objects and lfs_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.

Edited by George Koltsov

Merge request reports

Loading