Migrate Environment Variables #

Formatting Existing Environment Variables #

You can use the search + replace feature of your editor of choice to format your existing Environment Variables. We recommend using regexp search+replace with the following typical patterns.

Your Environment Variable Variable must be formatted in the following way: ENVKEY=ENVVALUE
Environment Variable Pattern Regex Search Replace
You need to escape all values with "" to avoid bash commands. You need to escape ! in values explicitly with \! due to the bash bang command analogy.

Prepare Existing Environment Variables #

💡Feature in Development Due to the beta status of SetOps, we currently do not support multiple Environment Variables per command, so only one Environment Variable per command is allowed.

To speed up the migration, you can use multiline copy+pasting into the terminal. To prepare your commands, you can do the following: We came up with a best practice to migrate ENVs:

  1. Copy your existing Environment Variables
  2. Paste them in your editor of choice
  3. Format them in the way described above
  4. Add following line with multiline cursor setops -p <PROJECT> -s <STAGE> --app <APPNAME> env:set
  5. Paste all commands in your terminal
  6. Commit the changeset: setops -p <PROJECT> -s <STAGE> changeset:commit
  7. Check Environment Variables in your App: setops -p <PROJECT> -s <STAGE> --app <APPNAME> env

Going further #

Read more about Environment Variables and how to set them in the Environment Variables Section.