Magento – How to export/import configs in Magento

magento2setup-script

We want switch to an integration system with our Magento installations. But I do not know how to export/import settings for deployment process.

I know in Drupal you use modules like Features and Strongarm, is there something similar in Magento?

Because we do not want change any settings in our live environment.

I found MageSetup, but I do not think that is exactly what I am looking for.

And I found this and this – can I address any config, that I can setup in admin panel, this way? Actually I do not want just override the config. I want safe it and when I go to admin panel, I want see there the new setting.

Is there such a feature in Magento 2?

Best Answer

Adding a late answer here to catch this post up to the current state of the times for the benefit of future Internet wanderers who find this.

As Haijerome wrote, for a long time there was no mechanism for selective configuration import or export built into Magento. This changed with Magento 2.2, when this ability was added to core. Now there is a CLI interface to dump/reload configuration to/from a file that can be versioned alongside the code. There is also the ability to lock certain configuration values to be controlled only in the file configuration and not in the database.

For those on earlier versions of Magento, there are some tools that can be used:

  • Magento 1: Haijerome mentioned the Magerun tool which allows stripped database exports. On its own this doesn't allow selective configuration import/export; however that can be achieved by using the Magerun addon HarrisStreet-ImpEx by Cyrill Schumacher, which allows import and export of configuration values to a variety of formats, including YAML, JSON and XML.
  • Magento 2.0-2.1: For these versions you can use Magento2-ConfigImportExport by Rouven Rieker that allows import and export of configuration values to YAML and JSON. This module plugs into the Magento 2 CLI, so it does not depend on Magerun.
Related Topic