Netlify LFS migration (fetching LFS to local directory)
1 minute
I haven’t updated my site in a while and when I came back, I was surprised to realise that LFS is no longer supported on Netlify. Thus began the process of migrating LFS from Netlify to Github.
Download LFS files
I was lucky I had all my assets kept in one folder. This made the retrieving of LFS content much easier. If you placed your LFS files in different folders, you might need to spend quite some time here.
Netlify Credential Manger
The first step will be to install Netlify’s credential manager (please also ensure that you have npm installed). Because the lm sub-command was removed from Netlify’s CLI, we have to install an older version of the CLI with
1
npm i -g netlify-cli@17.38.1
Next, use
1
netlify login
to login into Netlify and
1
netlify lm:install
to install Netlify’s credential helper. Ensure Git’s credential helper is using Netlify
1
git config --global credential.helper netlify
After which, you can go ahead to open a new terminal to ensure that the credential helper is in effect.
Fetch LFS
This is where we download the assets using the command
1
git lfs fetch --all
Uninstalling large media
Once you’re completed with the above, you can refer to https://answers.netlify.com/t/support-guide-uninstalling-large-media/17662 for the official documentation on uninstalling large media.
(Updated: )