Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cully's avatar

Duplicate Environment Variables

I have a site that I deploy via forge. I want to have a subdomain that I use basically as access to a beta edition for the original main site. Is there a straight forward way that I can copy all of the environment variables from the main site to use for the beta site?

0 likes
3 replies
bashy's avatar

Probably need something custom if you want to use the same database env vars. Is it two installs? Bit more info :)

cully's avatar

I want to use a different database for migrations for the beta site but essentially all of the rest of the environment variables will be the same. I have a dev branch and a master branch. I have two sites set up on forge on a single server, and basically when I push to dev, it publishes to one site and if I push to master it publishes to another.

I have >15 environment variables and I want to make sure I transfer all of them and then change which ones need to be different for the beta site.

cmgmyr's avatar

You can click the "Edit Configuration Files" (bottom right) and copy the environment variables from one site and copy them to the other. Note that Forge probably won't notice the change and the variables won't show in the Environment tab of the second site.

Please or to participate in this conversation.