Skip to main content

Environment files

Every separate environment (Bolt) is unique and has its own API key and Envornmental ID. Moving the environment.json file from one bolt to another would cause the destination to no longer be able to communicate with the Servebolt API.

The system works these out by reading the file and using the information with API calls.

How the Environment files are created.

In the Servebolt admin screen, choose the wanted Bolt, and then choose Settings. Near the bottom of the screen change the "Environment file in home folder" to be anything but "none". Mostly "both" is chosen.

Where are they stored.

They are stored in the home folder of the Bolt, 1 directory above the public directory.

Which file has preference?

The system will try to load the environment.json file first, and then the environment.ini file if the .json does not exist.

Are the files loaded every time?

The environment filepath is loaded and then saved in the options table. This is used to access the file on every load. Sometimes this can cause problems with restores from one environment to another. To remove the setting, delete the option and the system will try again.

wp option delete servebolt_env_file_path

Example Environment.json

{
"id": 111111, // environment id
"bolt_id": 111111, // the bolt id
"name": "example-com", // the name in the control panel
"api_key": "aKKOPSmszca516SnNUO0hsarP1QpgkHXJvuWlRBK8w0IScMhZsv6yClMHoqKyW1L", // unique api key that only works for this bolt id and environment id.
"internal_domain": "exampl-111111.server.servebolt.cloud", // Its test domain name, and the domain name we use internally
"internal_url": "https://exampl-111111.server.servebolt.cloud", // the url
"home_dir": "/kunder/serveb_111111/exampl_111111", // The home directory of the bolt, also where the environment.json is held
"public_dir": "/kunder/serveb_111111/exampl_111111/public", // The Webroot of your website
"private_dir": "/kunder/serveb_111111/exampl_111111/private", // Private area could be used for systems that have secure uploads
"api_url" : "https//api.servebolt.io" // the domain name used for calls to Servebolt API, this overrides the default value set in Servebolt Optimizer when present.
}