How to copy environment variables from one Heroku app to another

Uros Randelovic
1 min readJul 18, 2020

A note for my future self, that’s going to hopefully help some soul out there:

On Windows:

  1. Download Cygwin
  2. Authenticate with Heroku
heroku login

3. Download Heroku env from app A

heroku config -s -a your-app-A > envvars.txt

4. Load the variables into App B

cat envvars.txt | tr '\n' ' ' | xargs heroku config:set -a your-app-B

🎂 here is a cake for your success

--

--

Uros Randelovic
Uros Randelovic

Written by Uros Randelovic

Making data science & computer science accessible

Responses (5)