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.
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.
git lfs fetch --allThis 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.
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.
git config -f .lfsconfig lfs.url YOUR_LFS_URL
git add .lfsconfigReplace YOUR_LFS_URL with the value shown on your repository page in the dashboard.
Set up credentials for the new server
Git needs an access token to authenticate with LFS Harbor.
- Go to the LFS Harbor Dashboard.
- Click on your repository.
- Click Create token.
- Name the token and set the expiry.
- Copy the username and token value.
- Store the credentials with Git's credential helper:
git credential approve <<EOF
protocol=https
host=lfs.lfsharbor.com
username=YOUR_USERNAME
password=YOUR_ACCESS_TOKEN
EOFReplace 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).
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.
git lfs push --all originIf your remote is named something other than origin, replace it above. You can check with git remote -v.
Verify the migration
Clone the repository fresh into a temporary directory to confirm everything resolves from the new server.
git clone <your-repo-url> /tmp/migration-test
cd /tmp/migration-test
git lfs pullIf 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.