> Source: [sk165938](https://support.checkpoint.com/results/sk/sk165938)

# sk165938 - How to configure persistent environment variables on the Management Server

| Property | Value |
|----------|-------|
| Solution ID | sk165938 |
| Date Created | 2020-03-30 |
| Last Modified | 2025-05-14 |
| Technical Level | General |
| Products | Security Management Server, Multi-Domain Security Management Server |
| Versions | R82, R81.20, R81.10 (EOS), R81 (EOS), R81 (EOS), R81.10 (EOS), R81.20, R82 |
| OS | Gaia |

## Solution

Environment variables might not survive upgrades, and this may cause old issues to reoccur.

This problem was fixed. The fix is included in:

* [Check Point R81](https://support.checkpoint.com/results/sk/sk166715) and higher
* [Jumbo Hotfix Accumulator for R80.40](https://support.checkpoint.com/results/sk/sk165456) starting from Take 53
* [Jumbo Hotfix Accumulator for R80.30](https://support.checkpoint.com/results/sk/sk153152) starting from Take 210
* [Jumbo Hotfix Accumulator for R80.20](https://support.checkpoint.com/results/sk/sk137592) starting from Take 160
* [Jumbo Hotfix Accumulator for R80.10](https://support.checkpoint.com/results/sk/sk116380) starting from Take 278

**Syntax to set an environment variable:**

* To set an environment variable on-the-fly (applies only to the current shell):

  `[Expert@HostName]# $MDS_FWDIR/scripts/reload_env_vars.sh -e "<VARIABLE>=<VALUE>"`

  Example:

  `[Expert@HostName]# $MDS_FWDIR/scripts/reload_env_vars.sh -e "NGM_QUERY_LIVENESS_OPTIMIZER=1"`
* To set an environment variable permanently (survives reboot and upgrade):

  `[Expert@HostName]# $MDS_FWDIR/scripts/override_server_setting.sh -e <VARIABLE> <VALUE>`

  Example:

  `[Expert@HostName]# $MDS_FWDIR/scripts/override_server_setting.sh -e NGM_QUERY_LIVENESS_OPTIMIZER 1`

**Syntax to unset an environment variable:**

* To unset an environment variable on-the-fly (applies only to the current shell):

  `[Expert@HostName]# $MDS_FWDIR/scripts/reload_env_vars.sh -u <VARIABLE>`

  Example:

  `[Expert@HostName]# $MDS_FWDIR/scripts/reload_env_vars.sh -u "NGM_QUERY_LIVENESS_OPTIMIZER"`
* To unset an environment variable that was set permanently (survives reboot and upgrade):

  * For the Management Server versions R82 and higher, or R81.20 Jumbo Hotfix Take 79 and higher, R81.10 Jumbo Hotfix Take 158 or higher:

    `[Expert@HostName]# $MDS_FWDIR/scripts/override_server_setting.sh -u <VARIABLE>`

    Example:

    `[Expert@HostName]# $MDS_FWDIR/scripts/override_server_setting.sh -u "NGM_QUERY_LIVENESS_OPTIMIZER"`
  * For all lower Management Server versions:

    1. Back up the current `$MDS_FWDIR/conf/cpmEnvVars.conf` file:

       `[Expert@HostName]# cp -v $MDS_FWDIR/conf/cpmEnvVars.conf{,_BKP}`
    2. Edit the current `$MDS_FWDIR/conf/cpmEnvVars.conf` file:

       `[Expert@HostName]# vi $MDS_FWDIR/conf/cpmEnvVars.conf`
    3. Remove the line that contains the environment variable.

    4. Save the changes in the file and exit Vi editor.

Notes:

* There is no validation for the values you configure.
* For the variables to survive upgrade you must have this tool on the machine before the upgrade.

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
