Copying env vars from one site to another

I am trying to copy my environment variables from one Netlify site to another from my command line locally.
I have Netlify cli installed and I am logged in. I have also generated a personal access token.
I tried with
npx netlify-copy-env-vars from-site-domain-whole-url to-site-domain-whole-url --token=23453153asdfasfdadcacafrfdafdasffdsa
and
npx netlify-copy-env-vars name-of-site-from name-of-site-to --token=23453153asdfasfdadcacafrfdafdasffdsa

these tokens here are in the example from https://github.com/morrislaptop/netlify-copy-env-vars
not my personal token. However this does not work. Gives me error:
JSONHTTPError: Not Found

is there another way? or how to get this way to work? Thanks folks!

I’d take about 10 steps back and get the plain calls made using something like curl first, before moving them into packages whose source code our staff won’t be able to help you debug.

Per this article:

…what are the calls to show/set? Let’s get those working from or postman or something - we’ll be able to help that far - and then you can embed them in node scripts afterwards but our staff won’t be able to help debug that code :slight_smile:

Thanks @fool It looks like I better build that function my self. I already started and have now a node repo where I get the env variables, now I need to build them too :slight_smile:

Plan (for now) is to read the local .env file and push that to Netlify admin. With this method I can have in sync the local repo and Netlify. It is way easier and quicker to write quickly a text file than clicking anything in the admin.

1 Like