data-migration-tool icon indicating copy to clipboard operation
data-migration-tool copied to clipboard

Feature Request: Possibility to split the option files declared in config.xml to multiple files.

Open strajeru opened this issue 4 years ago • 1 comments

Story: As a developer, I would like to split my configuration files for data migration so I can easily group, isolate and change migration config based on their functionality.

Example the xpath config -> options -> map_file from the config.xml.dist file contains on string at the moment

<config ...>
        ....
        <options>
            <map_file>etc/opensource-to-opensource/1.9.4.5/map.xml.dist</map_file>
            ....
        </options>
         .....
</config>

If I want to add my own custom maping rules for documents and fields, I need to copy the file etc/opensource-to-opensource/1.9.4.5/map.xml.dist to a custom module and add my changes in the file clone and then replace in the config file the map_file tag. This map.xml.dist file has by default 2k+ lines and if I add a few dozens it becomes hard to follow. Ideally I could create my own map file with just my custom settings. and leave the core one untouched.
so the configuration above becomes

<config ...>
        ....
        <options>
            <map_file>
                <core>etc/opensource-to-opensource/1.9.4.5/map.xml.dist</core>
                <custom_file_1>Vendor_Module/etc/file1.xml</custom_file_1>
                <custom_file_2>Vendor_Module/etc/file2.xml</custom_file_2>
                 ....
              </map_file>
            ....
        </options>
         .....
</config>

the tag names core, custom_file_1 are not important. So instead of loading a single file, the Migration\Reader\Groups::init method would read multiple files and merge the contents. To keep backwards compatibility, the $groupsFile parameter can be either string or array. If it's a string, it should behave like it does not, if it's an array it should read all of files in the array.

strajeru avatar Feb 25 '21 14:02 strajeru

Hi @strajeru. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Feb 25 '21 14:02 m2-assistant[bot]