[Support Guide] Uninstalling Large Media

Important

This guide covers the process of uninstalling the Large Media add-on for a site.

Notice: Once our support team uninstalls the Large Media add-on any copies of those files are no longer retrievable using our service. Please be absolutely certain you have local backups of all required files before directing our support team to uninstall the Large Media add-on from your site.

Uninstalling Large Media

Two considerations before we begin

There are several ways to approach removing the add-on. There are two main factors which influence the steps taken when uninstalling Large Media from a site.

Consideration #1: Will you test the uninstall on a new branch or production?

Our typical recommendation is to make the changes on a new branch and then merge those changes to the production branch once the tests are successful.

In my experience though, most people just do the test on the production branch. Whichever you choose is up to you. If there are questions, please let us know in the new topic you will create (more on that below).

Consideration #2: Are you still using Git LFS but not Large Media?

Are you still tracking these files in Git LFS and just want to stop using Large Media as the Git LFS service? If so, there are special environment variables which must be added for the new Git LFS service to be used by the build systems at Netlify.

Those environment variables are GIT_LFS_ENABLED=true (which is always needed for any other Git LFS service) and optionally GIT_LFS_FETCH_INCLUDE. There is more information here.

If your repository will stop using Git LFS completely, then do not use these environment variables. They apply only to repos using Git LFS (but not Large Media).

Uninstalling

Make a topic requesting a Large Media uninstall

Do you have the files backed up locally? If so, please create a new topic in Admin asking us to remove the Large Media add-on for your site. You can send us a link to the site, the site’s API id (the id not the key), and or site subdomain. Whichever you prefer is fine but we need some way to know which site to remove the add-on from.

After the support team replies to the topic, remove the .lfsconfig file

Once our support team replies to the topic that the Large Media add-on was removed from the site, delete the file .lfsconfig from the repo and commit that deletion.

However, wait and do not push the commit upstream yet.

This commit can be done on a new branch just for testing or it can be done on the production branch if you prefer. If using a non-production branch make sure your site is configured to deploy other branches under Site Name > Settings > Build & deploy > Deploy contexts.

This file is deleted because .lfsconfig is the file that says “Netlify is my Git LFS service”. Removing it makes the upstream Git repo service the Git LFS service again (GitHub, GitLab, Bitbucket, or similar).

Optional steps: add environment variables and push all Git LFS assets upstream

Are you still using Git LFS and just not Large Media? If the answer is “yes” keep reading. If not, skip this step.

If you have completely stopped using Git LFS for this repository, then skip the two steps below.

Add environment variable (optional)

If the repo is still using Git LFS, before pushing the change upstream, remember to add GIT_LFS_ENABLED=true and (optionally) GIT_LFS_FETCH_INCLUDE only if they are needed as mentioned above.

Remember to add the environment variable(s) in the web app ( under Site Name > Settings > Build & deploy > Environment).

Those environment variables apply to the git clone and, therefore, you must add them to the site settings and not in netlify.toml. We don’t have netlify.toml until after the clone is complete which is why the environment variable(s) must be added in the web app (again, only if they are needed).

Push all Git LFS assets to the upstream repo (optional)

There is a possibility that new files were added to Git LFS while Large Media was the Git LFS service. If so, then the Git host’s LFS service probably doesn’t have copies of those newly added files.

This step makes certain that any new/missing files are sent to the Git host’s LFS service also.

Because the .lfsconfig file has been deleted from the repo, Git will treat the Git host for the upstream repo as the Git LFS service again. All that is needed now is to push all LFS assets to the upstream repo.

To this, run the following command in the local repo directory:

git lfs push --all origin

Trigger a build without Large Media

Remember how I said “do not push the commit upstream yet” above. Well, the time has come for the git push now. :wink:

Pushing the commit upstream will trigger a new deploy of the site (on whichever branch you are testing).

Was the deploy successful? When you browse the site do all the assets tracked in Git LFS still work? If so, the uninstall is complete and you are almost (or possibly completely) done.

If this was a testing branch, merge that branch into production. If you were testing on production, there is nothing left to do for the Large Media uninstall.

If the newly deployed site doesn’t have all media working, then please follow-up in the new topic you created and let us know. We will troubleshoot with you in that topic until we get it working.

Questions?

Again, if you want to remove Large Media from your site or if you have questions about your specific site - please don’t post below. Please make a completely new topic instead (in Admin). :slight_smile:

If, on the other hand, you do have questions about the guide above in general, you are always welcome to ask those questions by posting them here in this topic. :+1:

1 Like

Last reviewed in August 2021.

This guide was very clear, thank you. I just wanted to note a couple of small things that tripped me up, in the process of switching to the default git lfs origin:

  • It seems you need to “Clear cache and deploy site”, after deleting .lfsconfig and adding the environment variable(s). Before clearing cache I was getting an error from git lfs about a smudging error.
  • I added the variable GIT_LFS_ENABLED=true to my netlify.toml file. However, there was an error about marshalling a boolean into the JSON. Turns out it needs to be a string value: GIT_LFS_ENABLED="true". I imagine the same syntax would work when adding the environment variable via the Netlify dashboard? If so it might be best to write it that way in the instructions so it works in the TOML config too.