The Home for
Magento Excellence

Explore. Discover. Elevate. #magento

162
Modules Tested
98
Ready for Magento 2.4
64
Need Your Help
Stable v2.0.0
Ready to Install
Build tests pass on Magento 2.4.8-p3

Magento 2 DataPatchCreator

enanobots/m2-datapatchcreator

Allows us to create PHP Data Patch Files in Magento 2 Admin panel and export them to PHP files which we can add to our code repositories.

56,960
Downloads
Below average
55
GitHub Stars
Below average
12mo ago
Last Release
4
Open Issues

Quality Score

3/5
Installs via Composer
DI compiles correctly
Templates compile
PHPStan

Recent Test History

Each release is tested against the latest Magento version at that time.

v2.0.0 on Magento 2.4.8-p3
Dec 15, 2025
v2.0.0 on Magento 2.4.8-p2
Aug 14, 2025
v2.0.0 on Magento 2.4.8
May 18, 2025
v2.0.0 on Magento 2.4.7-p4
Feb 15, 2025
v2.0.0 on Magento 2.4.7-p3
Dec 20, 2024
v1.0.8 on Magento 2.4.7-p3
Oct 15, 2024

+8 older tests

GitHub Repository
Source code & docs
Packagist
Version history
Issues & Support
Get help or report bugs

Share This Module's Status

Magento 2 DataPatchCreator Magento compatibility status badge

README

Loaded from GitHub

Open Source Love

Magento 2 DataPatchCreator

When working with large teams, many times someone forgets to create a data patch for a cms page, block, configuration or a product attribute.
This module allows you to create PHP Data Patch Files in Magento 2 Admin panel and export them to PHP files which you can add to your code repositories.

Important:

This main version of the module does not work with PageBuilder to assure 2.3.x version compatibility.

If you want to make it work with PageBuilder from Magento 2.4.3 it is required to install additional composer package:

qoliber/m2-datapatchcreator-pagebuilder

Details: https://github.com/qoliber/m2-datapatchcreator-pagebuilder-compatibility

Installation

Installation is via composer

composer require qoliber/m2-datapatchcreator

After installing the packages just run:

php bin/magento setup:upgrade

Requirements:

  • PHP 8.1 and higher
  • Magento 2.3.x and higher

Tested on:

  • Magento 2.3.x OpenSource
  • Magento 2.4.x OpenSource

Available Data Types for data patches:

  • Product Attributes (with image swatches sync)
  • CMS Pages
  • CMS Blocks
  • Store Configuration
  • more to come in future releases

How to create data patches?

You do everything in Magento 2 admin panel. :)

There are 2 ways to create Magento 2 Data Patch files:

  • direct download (DEFAULT OPTION):
    • for a single entity, a PHP file is generated
    • for sets of data patch files (Mass Exports), a ZIP file containing patch files is generated
  • local files:
    • files are always created in specified location (both for single entities and mass exports)

Sync images between store copies:

Module allows images synchronization between Magento 2 store copies.
Class used to dump / fetch images needs to implement ImageSyncInterface

Default Image sync: LocalFile

  • Files are copied to target location when patch file is created
  • Files are copied from configured location to Magento 2 media folded

Adding new Image Sync Models:

Image Sync Models are passed into array of ImageSync class via DI.XML

    <type name="Qoliber\DataPatchCreator\Model\ImagesSync\ImageSync">
        <arguments>
            <argument name="syncModels" xsi:type="array">
                <item name="LocalFile" xsi:type="object">Qoliber\DataPatchCreator\Model\ImagesSync\LocalFile</item>
            </argument>
        </arguments>
    </type>

If you want to add a new ImageSync model, just add a new element to syncModels array via di.xml
This key needs to match the store configuration set for sync_model configuration value.

Create a plugin for SyncMethods and make sure the value field matches array key passed in di.xml.

For example:

    <type name="Qoliber\DataPatchCreator\Model\ImagesSync\ImageSync">
        <arguments>
            <argument name="syncModels" xsi:type="array">
                <item name="AmazonS3" xsi:type="object">YourVendor\YourModule\ImagesSync\AmazonS3</item>
            </argument>
        </arguments>
    </type>
        return [
            ['value' => "AmazonS3", 'label' => __('Copy images to designated folder')],
        ];

Setting configuration in the admin panel will make force usage of your module for images sync.

Suggested Packages:

  • PageBuilder Compatibility: https://github.com/qoliber/m2-datapatchcreator-pagebuilder-compatibility

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.

Back to All Modules