Skip to content

Migrating files to LFS

This guide shows how to migrate files that were (accidentally) not tracked by Git-LFS.

Follow this guide to inspect the ARC project storage in the DataHUB

You can easily check the usage quota used by your ARC by navigating to your ARC in the DataHUB and clicking on “Project Storage” in the right sidebar (1).

In terms of usage quota, two numbers are particularly important: LFS (1) and Repository (2) The majority of quota should fall into “LFS”, while the size of “Repository” should be kept small. If too many files are in “Repository”, this slows down the communication with and processing of your ARC.

  • At least Maintainer level permission for the ARC being modified
  • Git and Git-LFS installed locally
  • Enough disk space to download a fresh copy of the ARC

The selected large files in the (local) ARC are replaced by lightweight pointers. We recommend performing this on a freshly downloaded (“cloned”) ARC instead of the original copy on a user’s machine. For the migration, it suffices to download the ARC without already “properly LFS-tracked” large files, if the ARC is then synced back to the same remote (URL) in the DataHUB as shown below.

  1. In the DataHUB, allow “force push” for the ARC

    Details
    1. Open your ARC in the DataHUB
    2. Via the sidebar navigate to Settings —> Repository
    3. Open the section “Protected branches”
    4. Activate the button Allowed to force push
  2. Download a fresh copy of your ARC

    Details
    Terminal window
    arc get -n -r <ARC URL>
  3. Migrate to LFS

    You can use a pattern for a certain file type (here: .tiff and .fastq.gz) with

    Terminal window
    git lfs migrate import --everything --include="*.tiff,*fastq.gz"
  4. Force push the changes to the DataHUB

    Terminal window
    git push --all --force
  5. (Recommended:) Deactivate allowing force push (see step 1)

  6. (Recommended:) Run Housekeeping in the DataHUB

    Details
    1. Open your ARC in the DataHUB
    2. Via the sidebar navigate to Settings —> General
    3. Open the section “Advanced”
    4. Click the button Run housekeeping
    5. Click the button Prune unreachable objects