Skip to content

Copying Heroku Environment Variables Across Projects

Zayyana Khoir edited this page Dec 22, 2021 · 1 revision

Copying Heroku config to local file

Using the Heroku CLI you can copy all of the config variables out of a project into a local file:

heroku config -s -a {PROJECT_NAME} > config.txt

Setting values from local file into Heroku project

You can also do the opposite, push config values into a Heroku project:

cat config.txt | tr '\n' ' ' | xargs heroku config:set -a {PROJECT}

Clone this wiki locally