LFS HarborLFS Harbor

Migrate from another provider

Move your Git LFS objects from one server to another without losing history or re-tracking files.

How it works — Git LFS stores large files on a separate server. Your Git history contains small pointer files that reference those objects by hash. To migrate, you download every object from the old server, point your repository at the new one, and push them back up. The pointer files and tracking rules stay the same.

Prerequisites — Git LFS is installed (git lfs install), you have push access to the old server, and the new server is ready to receive objects. If you're migrating to LFS Harbor, follow Configure your server first.

1

Download all LFS objects from the old server

Pull every LFS object across all branches and tags into your local cache. This ensures nothing gets left behind.

bash
git lfs fetch --all

This can take a while for large repositories and needs enough disk space to hold every version of every tracked file. Check usage with du -sh .git/lfs.

2

Point your repository at the new server

Tell Git which server handles LFS objects for this repository. Using .lfsconfig keeps the setting in version control so your team picks it up automatically.

bash
git config -f .lfsconfig lfs.url YOUR_LFS_URL
git add .lfsconfig

Replace YOUR_LFS_URL with the value shown on your repository page in the dashboard.

3

Set up credentials for the new server

Git needs an access token to authenticate with LFS Harbor.

  1. Go to the LFS Harbor Dashboard.
  2. Click on your repository.
  3. Click Create token.
  4. Name the token and set the expiry.
  5. Copy the username and token value.
  6. Store the credentials with Git's credential helper:
bash
git credential approve <<EOF
protocol=https
host=lfs.lfsharbor.com
username=YOUR_USERNAME
password=YOUR_ACCESS_TOKEN
EOF

Replace YOUR_USERNAME and YOUR_ACCESS_TOKEN with the values from the dashboard. Git will use whichever credential store is configured on your machine (keychain on macOS, libsecret on Linux, Windows Credential Manager on Windows).

4

Push all LFS objects to the new server

Upload every locally-cached LFS object to the new server. The --all flag pushes objects from all branches and tags, not just the current one.

bash
git lfs push --all origin

If your remote is named something other than origin, replace it above. You can check with git remote -v.

5

Verify the migration

Clone the repository fresh into a temporary directory to confirm everything resolves from the new server.

bash
git clone <your-repo-url> /tmp/migration-test
cd /tmp/migration-test
git lfs pull

If git lfs pull completes without errors, the migration is done. You can delete the temporary clone.

Multiple repositories

LFS objects are stored per-repository. Repeat the steps above for each repository you want to migrate.

Collaborators

If you committed the .lfsconfig change, your collaborators will pick up the new server URL the next time they pull. They will need to set up credentials for the new server — their cached objects from the old server will continue to work locally.