# magebit/module-magento2-configurator

> Keep Magento persistently configured using version-controlled files.

`composer require magebit/module-magento2-configurator`

Canonical URL: https://packagento.com/magebit/module-magento2-configurator

## At a glance

- **Vendor**: magebit (https://packagento.com/magebit.md)
- **Latest version**: 2.0.5 — released 2026-06-16
- **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/magebit/module-magento2-configurator 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 magebit/module-magento2-configurator:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Keep Magento persistently configured using version-controlled files.

## README

Keep Magento persistently configured from version-controlled files. Define your
store configuration (websites, attributes, categories, CMS, tax, customers, …)
as YAML/CSV, commit it, and apply it to any environment with a single command.

Originally created by [CTI Digital]; this is Magebit's **v2** line — a
modernised, self-owned fork under the `Magebit\Configurator` namespace
(`Magebit_Configurator`).

### Why

- Stand up a store from scratch with its important DB-backed configuration ready.
- Share and version configuration alongside your code.
- Apply environment-specific configuration (local / stage / live).
- Re-run safely: components are idempotent and a `--dry-run` previews changes.

### Requirements

- **Magento Open Source / Adobe Commerce 2.4.7 – 2.4.9** (all currently non-EOL)
- **PHP 8.1 – 8.5** (the union supported across those Magento versions)
- `firegento/fastsimpleimport ^2.0`

### What's new in v2

- **`Magebit\Configurator` namespace** / `Magebit_Configurator` module.
- **Typed component contract** — `execute(ComponentContext): ComponentResult`
  (replacing the untyped `execute($data)`); `strict_types`, promoted `readonly`
  constructors throughout.
- **`--dry-run`** — preview what each component would create/update/skip without
  persisting anything (raw SQL, imports and saves are all guarded).
- **Meaningful exit codes** — `configurator:run` returns non-zero when any
  component reports an error, and prints a run summary
  (`created N, updated N, skipped N, removed N, errors N`). A single failing
  component no longer aborts the whole run.
- **Uniform reconciliation** — every component honors `create`/`maintain` mode
  and per-entity / per-component versioning through one shared gate (see below),
  so `create` mode is safe on production.
- **New capabilities** — MSI: `inventory_sources` (sources/stocks) + a
  `products` `msi_sources` column; widget layout placement via `page_groups`;
  optional Hyvä Commerce CMS components (`hyva_pages` / `hyva_blocks`);
  opt-in entity removal via `remove: true` across the entity components (CMS,
  config, widgets, rewrites, categories, attributes, tax rules, …) — see
  [`docs/schema/`](docs/schema/README.md#removing-entities-remove-true).
- **Documented config contract** — every component's source format is in
  [`docs/schema/`](docs/schema/README.md).

> **Upgrading from the CtiDigital v1 module?** See
> [`docs/UPGRADE.md`](docs/UPGRADE.md) — your config files keep working, but the
> package/module names, PHP/Magento support and reconciliation behaviour changed.

### Getting started

1. Install: `composer require magebit/module-magento2-configurator:^2.0`
   (from your configured composer repository).
2. Create `app/etc/master.yaml` (see [`Samples/master.yaml`](Samples/master.yaml)).
   Source paths are resolved relative to the Magento base dir, e.g.
   `app/etc/configurator/Attributes/attributes.yaml`.
3. Enable the modules: `bin/magento module:enable Magebit_Configurator FireGento_FastSimpleImport`
   then `bin/magento setup:upgrade`.
4. Apply: `bin/magento configurator:run --env="<environment>"`

#### Usage

```bash
bin/magento configurator:list                                   # list components
bin/magento configurator:run --env="local"                      # run all
bin/magento configurator:run --env="local" --component="config" # run one (repeatable)
bin/magento configurator:run --env="local" --dry-run            # preview, no writes
bin/magento configurator:run --env="local" -i                   # ignore missing source files
bin/magento configurator:run --env="local" -v                   # verbose logging
```

#### Syncing from the database

The reverse of `configurator:run` — read the current DB state and write it back
into the source files, so changes made in the admin can be captured into git.
Components opt in by implementing `ExportableComponentInterface`.

**Supported:** `config`, `blocks`, `pages`, `widgets`, `websites`,
`customergroups`, `adminroles`, `adminusers` (no passwords), `apiintegrations`
(no tokens), `order_statuses`, `review_rating`, `taxrates`, `taxrules`,
`catalog_price_rules`, `rewrites` (non-autogenerated only), `shippingtablerates`,
`inventory_sources`, `hyva_pages`, `hyva_blocks`, `attributes` (incl. options &
swatches), `customer_attributes`, `attribute_sets` (groups + user-defined
attributes), `categories` (full tree).
**Not supported** (bulk/imperative — use Magento's own export for products/
customers): `products`, `customers`, `sql`, `sequence`, `media`.

```bash
## Refresh the values of the config paths you already track, in place:
bin/magento configurator:sync-from-db --component=config
bin/magento configurator:sync-from-db --component=config --dry-run   # preview

## Full export of everything in scope, optionally filtered and to a chosen file:
bin/magento configurator:sync-from-db --component=config --all --path="web/" --output="app/etc/configurator/Config/web.yaml"
```

- Default mode refreshes only the entries already present in the source files
  (low-noise); `--all` dumps everything in scope, `--path=` filters by prefix.
- For `pages`/`blocks` entries that reference an external `source:` file, the
  current DB content is written **into that file** (created if missing), not
  inlined into the YAML — so template-sourced content round-trips.
- Encrypted config values are never written out, so secrets stay out of git.
- Only values actually stored in `core_config_data` are pulled (defaults from
  `config.xml`/`env.php` are left as-is).
- A component that fails to export is logged and skipped; the rest still run and
  the command exits non-zero.

### Reconciliation: modes & versioning

Every component now applies the **same** rule for how config reconciles against
existing data, via a shared `ReconciliationGate`:

_(README truncated for .md surface. Full README on https://packagento.com/magebit/module-magento2-configurator.)_

## Recent Versions

| Version | Released |
|---|---|
| 2.0.5 | 2026-06-16 |
| 2.0.4 | 2026-06-10 |
| 2.0.3 | 2026-06-09 |
| 2.0.2 | 2026-06-09 |
| 2.0.1 | 2026-06-09 |
| 2.0.0 | 2026-06-08 |
| 1.0.5 | 2026-06-02 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| firegento/fastsimpleimport | ^2.0 |
| php | >=8.1 <8.6 |
| symfony/yaml | ~6.0\|~7.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| bitexpert/phpstan-magento | ^0.30 \|\| ^1.0 |
| magento/magento-coding-standard | * |
| phpmd/phpmd | ^2.15 |
| phpstan/phpstan | ^1.12 |
| phpunit/phpunit | ^10.5 \|\| ^11.0 |

## Quality

Latest release (2.0.5) 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 | Fail | 359 | 9 errors, 350 warnings (ruleset: Magento2) — 8 auto-fixable with phpcbf |
| PHPMD | Warning | 148 | 148 rule violations (MissingImport:33, TooManyPublicMethods:26, UndefinedVariable:20, ExcessiveClassComplexity:18, NPathComplexity:15) |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### 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 | 177 | 177 | – | – |
| 2.4.8 | – | 177 | 177 | – |
| 2.4.9 | – | – | 177 | 177 |


### 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 | not tested | – |
| 2.4.9 | – | – | Error | Error |

#### 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 | N/A | 0 | no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1 |
| 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=["magebit/module-magento2-configurator"],
  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

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

