# Understanding Studio’s Environment Overrides¶

It is very common for organizations to have several environments including:

• Production
• Staging
• QA
• Dev
• Local developer installs

The challenge in these scenarios with most CMS technology is moving content and configuration from one environment to another. One of the major differences between environments is typically anything with a server name in it and where content should be deployed. Crafter Studio manages these configurations in the repository and it stores each environment’s configuration as a different file so that all environment configurations can coexist at the same time in the repository. Studio is then configured to look at a specific environment file.

## Changing the Environment Studio is Configured to Be¶

TOMCAT/shared/classes/crafter/studio/extension/server-config.properties
environment=local
environmentConfig.environment=local


Note: After setting these two properties, please restart the server.

## Modifying an Environment Config File¶

• In the repository you will find the environment overrides files at: REPO/cstudio/config/sites/environment-overrides
• Each environment will have a folders for it with a name that should match the values in server-config.properties (see above.)
• Inside the environment folder you will see a file called environment-config.xml that contains configuration similar to what is listed below.
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  http://localhost:8080 http://localhost8080/studio NOT USED http://mysite.com prod-server-01 prod-server-02 true admin localhost false 

The addresses in preview-server-url and authoring-server-url should match your protocol, servername and port exactly. For example if your CMS is running on a over https on a server called cms.myco.com your environment-config.xml might looks something like:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  https://cms.myco.com https://cms.myco.com/studio NOT USED http://mysite.com prod-server-01 prod-server-02 true admin myco.com false 

## Ordering Publishing Targets¶

In the case where you have multiple environments, you can order the publishing targets. Below is an example:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37  http://127.0.0.1:8080 http://127.0.0.1:8080/studio http://127.0.0.1:8080/form-server http://SITENAME 2 samplez false 3 samplex false 1 sample true 127.0.0.1 false 

The above example will produce the following list for the publishing targets:

• Production
• Stage
• Z-Env

## Editing environment-config.xml via Crafter Studio Admin Console¶

You can use Crafter Studio’s admin console configuration tool to edit environment-config.xml files. You may need to add them to the configuration in order for them to show up.

If your environment config file is not listed in the configurations dropdown simple select the option call configurations and add the following entry to the list of files

<file>
<path>/environment-overrides/YOUR_NVIRONMENT_NAME/environment-config.xml</path>
<title>YOUR_NVIRONMENT_NAME environment overrides configuration</title>
<description>YOUR_NVIRONMENT_NAME environment overrides configuration</description>