# semaio/magento2-configimportexport

> Import/Export core_config_data values in Magento 2

`composer require semaio/magento2-configimportexport`

Canonical URL: https://packagento.com/semaio/magento2-configimportexport

## At a glance

- **Vendor**: semaio (https://packagento.com/semaio.md)
- **Latest version**: 5.0.0 — released 2026-05-29
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/semaio/magento2-configimportexport and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require semaio/magento2-configimportexport:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Import/Export core_config_data values in Magento 2

## README

This extension provides CLI commands for Magento 2 to import/export system configuration data. 

### Why this extension?

While Magento 2 offers the `app:config:dump` / `app:config:import` commands, they're limited to one environment and a little bit hard to manage, especially in CI/CD setups. 

This extension supports managing configuration values for multiple environments (production, staging, etc.) out-of-the-box, defining and overwriting base configuration values in a specific environment. It also allows different file formats (e.g., YAML, JSON). In general, it makes that process a bit more streamlined and easier to manage, with the added benefit of generalization and cross-compatibility with other agencies/merchants using this.


### Installation

**Add the package to your composer.json**

```bash
composer require semaio/magento2-configimportexport
```


**Enable and install the module**

```bash
php bin/magento module:enable Semaio_ConfigImportExport
php bin/magento setup:upgrade
```


### Facts

* Supported Magento versions are 2.4.4+.
* Supported PHP versions are 8.1, 8.2, 8.3, and 8.4.


### Functionality

This module is a work in progress and will be extended in the future with more functionality and support for other file formats.


#### File formats

This module currently supports the following file formats:

* YAML (default)
* JSON

See [docs/file-formats.md](docs/file-formats.md) for more information and examples.


#### Import config data

See [docs/config-import.md](docs/config-import.md) for more information.


#### Export config data

See [docs/config-export.md](docs/config-export.md) for more information.

### Usage with Deployer

When using a push approach in CI/CD, the environment variables should be replaced on the runner and not on the initiating host or target host. For this, you can use this Deployer task to do this and import the config settings;

```
task('magento:config:set', function () {
    $resolver = new \Semaio\ConfigImportExport\Model\Resolver\EnvironmentVariableResolver();
    $glob = glob('config/store/**/*.yaml');
    array_walk($glob, function ($file) use ($resolver) {
        if (file_put_contents($tempFile = tempnam('/tmp', get('clientslug')), $resolver->resolveValue(file_get_contents($file)))) {
            upload($tempFile, get('release_path') . '/' . $file);
        }
    });
    run('{{bin/php}} {{release_path}}/bin/magento config:data:import {{release_path}}/config/store ' . get('environment'));
});
```

### Support

If you encounter any problems or bugs, please create an issue on [GitHub](https://github.com/semaio/Magento2-ConfigImportExport/issues).


### Contribution

Any contribution to the development of MageSetup is highly welcome. The best possibility to provide any code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).


### Licence

[Open Software License (OSL 3.0)](http://opensource.org/licenses/osl-3.0.php)


### Contributors

Thanks to all [contributors](https://github.com/semaio/Magento2-ConfigImportExport/graphs/contributors) who invested their valuable time to contribute to this module. Much appreciated!


### Inspiration

This module is inspired by the awesome n98-magerun plugin "HarrisStreet ImpEx" by @SchumacherFM for Magento 1 which you can find [here](https://github.com/Zookal/HarrisStreet-ImpEx).


### Copyright

(c) 2016-2022 semaio GmbH / Rouven Alexander Rieker

## Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [Unreleased]

* ...

### [5.0.0] - 2026-05-29

#### Changed

* Drop support for PHP 7.x — minimum is now PHP 8.1
* Drop support for symfony/yaml 3.x, 4.x, and 5.x (all EOL) — constraint is now `^6.0|^7.0`, resolves three low-severity Dependabot security advisories
* Fix PHP 8.4 compatibility: add missing return types to console command `execute()` and `configure()` methods (see [#85](https://github.com/semaio/Magento2-ConfigImportExport/issues/85)) by [@simonmaass](https://github.com/simonmaass)

### [4.4.0] - 2024-08-29

#### Changed

* Update symfony/yaml dependency to include ^7.0 (see [#79](https://github.com/semaio/Magento2-ConfigImportExport/pull/79)) by [@mp-sb](https://github.com/mp-sb)

### [4.3.0] - 2024-04-18

#### Added

* Support import for encrypted configuration values (see [#74](https://github.com/semaio/Magento2-ConfigImportExport/pull/74)) by [@Maksold](https://github.com/Maksold)
* Add support for keeping and not overwriting configuration values in specific environments (see [#75](https://github.com/semaio/Magento2-ConfigImportExport/pull/75)) by [@vpodorozh](https://github.com/vpodorozh)

### [4.2.0] - 2023-09-29

#### Added

* Allow running import command with empty directories (see [#71](https://github.com/semaio/Magento2-ConfigImportExport/pull/71)) by [@torhoehn](https://github.com/torhoehn)

#### Changed

* Fix theme import behavior where theme names containing a dash could not be resolved (see [#72](https://github.com/semaio/Magento2-ConfigImportExport/pull/72)) by [@Morgy93](https://github.com/Morgy93)

### [4.1.0] - 2023-03-24

#### Added

* Support for project-specific resolvers and implement theme code resolver (see [#69](https://github.com/semaio/Magento2-ConfigImportExport/pull/69)) by [@therouv](https://github.com/therouv)

#### Changed

* Optimize file export (see [#68](https://github.com/semaio/Magento2-ConfigImportExport/pull/68)) by [@bluec](https://github.com/bluec)

### [4.0.0] - 2023-01-19

#### Added

* Export: Specify export file path through a new command option, refactor export file name and file path logic by [@bluec](https://github.com/bluec) and [@therouv](https://github.com/therouv)

#### Changed

* Allow numbers in environment variables by [@therouv](https://github.com/therouv)

### [3.10.1] - 2022-10-14

#### Changed

* Fix null value regression during import by [@therouv](https://github.com/therouv)
* Fix unit tests by [@therouv](https://github.com/therouv)

### [3.10.0] - 2022-10-13

#### Added

* Interactive env var support for local environments by [@peterjaap](https://github.com/peterjaap)
* Option to delete config values by [@DavidLambauer](https://github.com/DavidLambauer)

### [3.9.0] - 2022-09-29

#### Changed

* Added some validation checks for environment variables by [@peterjaap](https://github.com/peterjaap)

### [3.8.0] - 2022-09-29

#### Added

* Added support and documentation for using environment variables by [@peterjaap](https://github.com/peterjaap)

#### Changed

* Added documentation for previously undocumented base feature by [@peterjaap](https://github.com/peterjaap)

### [3.7.0] - 2022-08-17

#### Changed

* PHP 8.1 compatibility changes when using YAML export (handling of null values) [@therouv](https://github.com/therouv)

### [3.6.0] - 2022-05-31

#### Changed

* Allow PHP 8.1 for Magento 2.4.4 compatibility [@therouv](https://github.com/therouv)

### [3.5.1] - 2022-03-23

#### Changed

* Add compatibility to new `symfony/yaml` releases to fix config export command when using `--hierarchical=y` option [@therouv](https://github.com/therouv)
* Allow `symfony/yaml:^6.0` [@therouv](https://github.com/therouv)

### [3.5.0] - 2021-03-13

#### Added

_(Changelog truncated for .md surface. Full history on https://packagento.com/semaio/magento2-configimportexport.)_

## Recent Versions

| Version | Released |
|---|---|
| 5.0.0 | 2026-05-29 |
| 4.4.0 | 2024-08-28 |
| 4.3.0 | 2024-04-18 |
| 4.2.0 | 2023-09-29 |
| 4.1.0 | 2023-03-24 |
| 4.0.0 | 2023-01-19 |
| 3.10.1 | 2022-10-14 |
| 3.10.0 | 2022-10-13 |
| 3.9.0 | 2022-09-29 |
| 3.8.0 | 2022-09-29 |

Showing 10 of 27 versions. Full release history on https://packagento.com/semaio/magento2-configimportexport.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-config | * |
| magento/module-store | * |
| php | ^8.1 |
| symfony/yaml | ^6.0\|^7.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| phpunit/phpunit | * |

## Quality

Latest release (5.0.0) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 39 | 39 warnings (ruleset: Magento2) |
| PHPMD | Warning | 16 | 16 rule violations (MissingImport:12, CyclomaticComplexity:1, NPathComplexity:1, UnusedLocalVariable:1, DuplicatedArrayKey:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 3 | valid; 3 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 4 | 4 | – | – |
| 2.4.8 | – | 4 | 4 | – |
| 2.4.9 | – | – | 4 | 4 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Error | not tested |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["semaio/magento2-configimportexport"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

semaio is a Magento 2 vendor on Packagento. See https://packagento.com/semaio.md for their full catalogue.

