Configuration and Environment Variable Names Migration

Because the dev convert script conversion command doesn’t update configuration and environment variables to their new names, we recommend that you update them manually to avoid deprecation warnings. Although the existing sfdx-style variable names continue to work, we recommend that you start using the new sf-style ones. When you use the old ones, you get a warning with the name of the new configuration and environment variable to use.

If you’re still using version 7 of the sfdx executable of Salesforce CLI (also referred to as sfdx (v7)), move to version 2 of the sf executable (sf (v2)). See Move from sfdx (v7) to sf (v2) for details.

Note

Configuration Variables

The sfdx-style configuration variables are aliased to their sf-style equivalents. As a result, you can use either the sfdx or the sf variable names with the config commands. But the commands always work on the sf variable names. For example, config set and config unset always set the configuration with the sf name, even if you specify the sfdx name. All config commands display the sf name in their outputs, even if you specified the sfdx name in the command.

These examples show the rules in action.

1sf config set defaultusername=my-scratch-org
2Warning: Deprecated config name: defaultusername. Please use target-org instead.
3Set Config
4===================================
5| Name       Value          Success 
6| ────────── ────────────── ─────── 
7| target-org my-scratch-org true    
8
9sf config list
10List Config
11===========================================
12| Name              Value          Location 
13| ───────────────── ────────────── ──────── 
14| target-org        my-scratch-org Local    
15
16sf config get defaultusername
17Warning: Deprecated config name: defaultusername. Please use target-org instead.
18Get Config
19===================================
20| Name       Value          Success 
21| ────────── ────────────── ─────── 
22| target-org my-scratch-org true

Use this table to migrate your scripts to use the new sf-style configuration variable names.

sfdx-style Configuration Value Equivalent sf-style Configuration Variable
apiVersion org-api-version
customOrgMetadataTemplates org-custom-metadata-templates
defaultdevhubusername target-dev-hub
defaultusername target-org
disableTelemetry disable-telemetry
instanceUrl org-instance-url
maxQueryLimit org-max-query-limit
restDeploy org-metadata-rest-deploy

Environment Variables

You can set both the new sf-style and old sfdx-style environment variables. However, if they’re set to different values, Salesforce CLI uses the sf one and displays a warning.

To migrate most environment variables, change the initial SFDX to SF. However, some variables have bigger changes, as displayed in this table, while others haven’t changed their name. For the full list, see Salesforce CLI Environment Variables.

Equivalent sf-style Environment Variable Equivalent sf-style Environment Variable
SFDX_API_VERSION SF_ORG_API_VERSION
SFDX_CUSTOM_ORG_METADATA_TEMPLATES SF_ORG_CUSTOM_METADATA_TEMPLATES
SFDX_DEFAULTDEVHUBUSERNAME SF_TARGET_DEV_HUB
SFDX_DEFAULTUSERNAME SF_TARGET_ORG
SFDX_INSTANCE_URL SF_ORG_INSTANCE_URL
SFDX_MAX_QUERY_LIMIT SF_ORG_MAX_QUERY_LIMIT
SFDX_REST_DEPLOY SF_ORG_METADATA_REST_DEPLOY

For example, here’s how to set your default Dev Hub org to an alias with an environment variable before running the command to create a scratch org.

1SF_TARGET_DEV_HUB=MyDevHub sf org create scratch --definition-file config/scratch-def.json