Hello I would like to migrate my LFS to GitHub but I have not backed up the files from Netlify’s LFS. I had tried using lm:install but it doesn’t seem to work anymore.
Hi, @J370. If you already have Large Media working on your system, you should be able to backup all LFS files to your local system with this:
git lfs fetch --all
What happens when you run that command locally (while in the base of the repo directory)?
Hi, I had ran the command and it will ask for my username and password. Previously, I would be able to use lm:install to get Netlify’s credential helper. Currently, I’ve tried a combination of username and emails but couldn’t get authenticated.
Hi @luke, may I check if there’re any steps I can take for the problem above?
Hi @J370, thanks for the extra feedback.
Regarding the issue with username and password kindly follow the suggestions from the forums post below as it is similar to your issue.
Thanks.
Hi, @J370. Sorry about the delay here. The lm
subcommand was removed from the CLI tool in version 18.0.0 as covered in the release notes here:
https://github.com/netlify/cli/releases/tag/v18.0.0
Quoting:
To be able to use the lm
subcommand, you will need an older version of the CLI. That version can be installed like so:
npm i -g netlify-cli@17.38.1
Once that is installed, you should be able to get the Git credential helper installed again so you can pull any LFS files from the Large Media Git LFS service.
However, if there are any issues when attempting that, please reply here. If you do, I promise to respond to you promptly going forward.
This support guide may also be helpful if there are Git credential helper install issues:
Again, please reply here if you cannot get the LFS files downloaded locally. I’ll follow-up quickly if you do.
Hi @luke. Thank you for your reply. I was able to pull all the LFS files and am ready to remove Large Media. My id is f323f8df-3f60-4f7c-b957-da8990d74007.
Hi, @J370. We have removed the Large Media add-on from the site now.
Would you please push the commit removing .lfsconfig
to the upstream repository? This will trigger a new build.
Please keep in mind that you might want to run the command below after deleting the .lfsconfig
file:
git lfs push --all origin
This will sync the local repo’s LFS objects with the Git LFS service at the original Git host. It pushes any new binary blobs to their LFS service which may have been added after you moved the LFS service to Large Media.
Please let us know if there are any issues with the new build or deployed site.
Hi @luke, I had deleted the .lfsconfig
file but some of the images do not show up. I am currently using Git LFS with GitHub and had added in the GIT_LFS_ENABLED=true
environment variable.
Hi, @J370. Did you try running this after deleting .lfsconfig
?
git lfs push --all origin
That should push all LFS content to the new LFS service host (meaning push it to GitHub).
What I am guessing is happened is this:
- new files were uploaded to Git LFS at Netlify (meaning they would be missing at GitHub)
- when
.lfsconfig
was deleted now Git LFS files pull from GitHub - because of the first point above GitHub does not have a copy of the binary file information
Again, if that hypothesis above is correct (which is may not be, but if it is) then git lfs push --all origin
follow-up by a new build and deploy at Netlify should fix it.
However, if it does not, please let us know.
Hi @luke. I ran git lfs push --all origin
but there are still missing media. They do exist in GitHub though.
I am seeing the Git LFS pointers being returned for some images. For example:
$ curl -s <redacted URL for image>
version https://git-lfs.github.com/spec/v1
oid sha256:e032bb0dd167ab66ab8defe1e44c9a303d46e011cb8d45966180806e98b2e6be
size 956
That image was a webp
but I noticed that the file extension was mixed case as webP
. There is an environment variable named GIT_LFS_FETCH_INCLUDE
which defaults to this at Netlify:
GIT_LFS_FETCH_INCLUDE=*.jpg,*.png,*.jpeg,*.svg,*.gif,*.pdf,*.mp4,*.bmp,*.webp
This environment variable determines which LFS files will actually get downloaded when GIT_LFS_ENABLED=true
is used.
My best guess here is that this environment variable is case-sensitive which is causing the mix-case filename ending in webP
(instead of the all lower-case webp
) not to be downloaded by Netlify.
Would you be willing to create an environment variable in the web UI for the site at Netlify with the following value as a test?
GIT_LFS_FETCH_INCLUDE=*.jpg,*.png,*.jpeg,*.svg,*.gif,*.pdf,*.mp4,*.bmp,*.webp,*.webP
This adds the mixed-case version of the filename ending webP
to also get downloaded by Netlify.
Then, after the environment variable has been created, would you please trigger a new build of the site and let us know if that resolves the issue or not? If it does, all file extension variations used in the repo would need to be added to that environment variable.
Alternatively, you could just rename the file instead from filename.webP
to filename.webp
. That should also fix the issue. Please do whichever you prefer.
Again, if that does not resolve the issue, please let us know.
Hello, I had renamed all the files and managed to get it working. Thanks for your help