The script assumes that you have the underlying permissions and that your shell is logged in.
Run the following in the project directory:
curl -fsSL https://gist.github.com/Plopix/72851fd834395d154586b4ed2680310e/raw/migrate-env-vars-from-platformsh-to-upsun.js | node - <source-cli>:<source-project-id>:<source-env> <target-cli>:<target-project-id>:<target-env>