Magento – Magento 2: `magento app:config:import` doesn’t import system configuration

configurationimportmagento2system-config

I'd like to import system config through the app:config:import command.

I have update app/etc/config.php file with described customer/captch/enable config path:

<?php return array (
  'system' =>
  array (
    'default' =>
    array (
      'customer' =>
      array (
        'captcha' =>
        array (
          'enable' => '0',
        ),
      ),
    ),
  ),

  'modules' =>
  array (
    'Magento_Store' => 1,
    'Magento_Directory' => 1,
    'Magento_Eav' => 1,
    'Magento_Backend' => 1,
    [...]

I'm expecting after magento app:config:import the path customer/captch/enable with value 0 should be added to core_config_data table.

But it's not adding/updating expected record.

What's the point of magento app:config:import in this case?

Is there a way to import this config except using magento config:set?

It's working in the same way for env.php as well, unfortunately.

Magento version: 2.2.5

Best Answer

Magento directly uses values in the system array in the config.php or env.php files instead of importing them into the database because they require some pre- and post-processing actions.

See official documentation for more details:
https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-config-mgmt-import.html