2 min readMar 29, 2026by jakub

Data Patch Creator

The Data Patch Creator streamlines one of the most error-prone parts of Magento 2 development: creating PHP data patch files. Instead of manually writing patch classes, this module lets you generate them directly from the Admin Panel with a few clicks.

This is especially valuable in large teams where content changes (CMS blocks, product attributes, store configs) need to be version-controlled and deployed consistently across environments. Without data patches, these changes live only in the database and get lost during deployments — the Data Patch Creator ensures they're captured as code.

GitHub: qoliber/m2-datapatchcreator

Installation

Bash
composer require qoliber/module-datapatchcreator
bin/magento setup:upgrade

Features

  • One-click patch generation — Select any supported entity in the Admin Panel and export it as a PHP data patch file
  • Bulk export — Generate patches for multiple entities at once, downloaded as a ZIP file ready to drop into your module
  • Image synchronization — Syncs images across Magento instances using ImageSyncInterface, ensuring media is consistent between environments
  • Custom sync methods — Implement your own image sync strategy via dependency injection (S3, CDN, shared storage)
  • Broad compatibility — Works with PHP 7.3+ and Magento 2.3.x through 2.4.x

Supported Entity Types

EntityWhat gets patched
Product attributesAttribute definition, options, labels, sort order
CMS pagesTitle, content, layout, stores, URL key
CMS blocksIdentifier, title, content, stores
Store configurationsConfig path, value, scope
PageBuilder Compatibility

The main module is not compatible with PageBuilder for Magento 2.4.3+. Install the companion package for PageBuilder support:

Bash
composer require qoliber/m2-datapatchcreator-pagebuilder

How It Works

  1. Navigate to the entity you want to patch in the Magento Admin
  2. Click the "Create Data Patch" button (available on supported entity edit pages)
  3. The module generates a properly structured PHP data patch class
  4. Download the file and place it in your module's Setup/Patch/Data/ directory
  5. Run bin/magento setup:upgrade — the patch executes and your content is now version-controlled
Was this page helpful?
Data Patch Creator — Magento 2 Modules — Open Source | qoliber Docs