Is it possible to download the Netlify Function build assets? My regular computer is unfortunately out for repairs, and I made changes to my Netlify functions and deployed them from that computer, but I hadn’t pushed my changes to GitHub yet.
I now want to add another function, but I don’t want to lose the functions I added before my computer stopped working. I know that it’s possible to download a website’s build assets from Netlify, but I can’t see my functions in the zipped file. Is there a way to download the Netlify Function files from my deployed build?
Unfortunately, deployed functions cannot be downloaded at the moment. If you had done a Git-based build, we could have suggested you a workaround, but you obviously would not have needed that if you had the code on Git in the first place.
I’ll be probably working on something that could allow users to deploy the functions at a location where they can be downloaded for debugging purposes, but this would unfortunately not help folks that have already deployed their sites.
Thanks for the reply, alternatively would it be possible to push a website update without overwriting the existing functions? I might also try redirecting the specific functional calls to the permalink for this production build for the existing functions as a potential solution
Each deploy must be complete and will always “overwrite” the old one in some ways - if you publish at the same URL, only one deploy can be live. There is no way to do what you want, unfortunately.
However, since we do save each deploy in full today, you could roll back to the old one to keep using the functions, so they aren’t “deleted” or lost either. Just not “usable in any other deploy”, unfortunately.
Sorry I don’t have better news for you today. I suppose you’ll probably become more fanatical about pushing to git, but that won’t help you today
Thanks for the reply, what I ended up doing seems to be working in production so far. I deployed a new branch in prod that does not have my function, but added a redirect rule that points to the function path on my older production deploy using it’s Netlify permalink URL.
The two affected functions return the expected response.Not a perfect solution, but it will get the job done for a few days until I can recover my lost data.