Can a customer_attribute be mapped during a M1 -> M2 data migration, if so can anyone provide any clues on how to do that?

e.g M1 attribute tel => M2 attribute telephone


There is not direct way to map an attribute with a given attribute_code from Magento 1 to another with another attribute_code from Magento 2.

If both attributes have the same attribute_code an update is made.

What I've tried:

The data-migration-tool offers a transform handler \Migration\Handler\Convert that converts the value of one column for all rows or rows that meet a condition on value:value pair


        <handler class="\Migration\Handler\ConvertEavValue">
                    <param name="map" value="[one_column:1column]"/>
                    <param name="attributeCode" value="page_layout"/>

This will transform all rows that have the value one_column to 1column where attribute_code is page_layout for the catalog_category_entity_varchar.value column

The example provided usses \Migration\Handler\ConvertEavValue but the logic is the same for \Migration\Handler\Convert

This is NOT possbile for the attribute_code column due the fact that the migration process relies heavily on the attribute_code values. Changing the attribute_code value during migration will result in unwanted results. I deduced this from the several checks they make along the way to see if attribute_code values stay the same.

What I ended up doing:

Ran a post-migration script that updates the list of attribute_codes that I wanted to change.

  • where can i keep this code for customer custom attribute? – Ramesh Dec 14 '18 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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