I have done default migration using Data Migration Tool. Now I want to migrate data of my custom module for that I am following below link:


But, How can I run migrate:data command only for my custom module, As I don't want the command remigrate all data like customers, products, orders etc.

Let me know how can I run it for my custom modules only.

1 Answer 1


You can have a different configuration file for your entities only. In the link you referenced there is a section that explains how to create the migration configuration for a custom entity: https://devdocs.magento.com/guides/v2.4/migration/extend-the-tool.html#create-a-custom-step

It says to create a section in the config.xml file that you are using, but you can actually create a separate config file with just your entities. Following the example in the docs, your new config file can be called blog_migration_config.xml and it can looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    <steps mode="data">
        <step title="GreatBlog Step">
    <steps mode="delta">
        <step title="GreatBlog Step">
        <database host="..." name="...." user="...." />
        <database host="...." name="...." user="...." password="..." />

Create your map-greatblog.xml file also to map your data structure from magento 1 to magento 2 following the guidelines in the docs.

and you can run the migration command with your config file

bin/magento migrate:data [-r|--reset] [-a|--auto] {}

  • Thank you. I have run below command for my custom data migration php bin/magento migrate:data -a "app/code/Project/Migration/etc/opensource-to-opensource/" --reset Got below error: In Map.php line 92: XML file is invalid.
    – Yogita
    Apr 13, 2021 at 8:14
  • I have added steps like <integrity>Project\Migration\Step\GreatBlog\Integrity</integrity> I replaced the Vendor with Custom namespace that I am created while overriding config.xml & map.xml for data migration tool as the blog_migration_config.xml and all other files also reside into this module. Is I am doing anything wrong?
    – Yogita
    Apr 13, 2021 at 8:31
  • I have not added any map.xml file path in options of my custom config.xml file, then why the map.php file error?
    – Yogita
    Apr 13, 2021 at 15:52
  • Do I need to add custom map.xml or class-map.xml files
    – Yogita
    Apr 14, 2021 at 17:19
  • I donțt remember exactly, but the basic idea would be to start from the original config.xml file, add your own config as recommended and then remove the core steps
    – Marius
    Apr 14, 2021 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.