cancel
Showing results for 
Search instead for 
Did you mean: 

How to change EAV attribute_code on M1 to M2 migration?

How to change EAV attribute_code on M1 to M2 migration?

Hi there,

 

on my M1 store I'm using an extension which calculates the base price for a product from these four eav_attributes: amount, unit, base_amount, base_unit.

 

Thus this extension does not exist for M2, I bought another one which uses these eav_attributes: amount, unit, reference_amount, reference_unit.

 

On migration the values for "amount" and "unit" are migrated correctly, but I'm getting stucked on how to change the attribute_code from "base_amount" to "reference_amount".

 

Could you please give me a hint, how this could be done?

 

Thanks

Thorsten

5 REPLIES 5

Re: How to change EAV attribute_code on M1 to M2 migration?

Hi @thorsten_kleiba 

As base_amount is your custom attribute code then you can change from eav_attribute database table.

UPDATE `eav_attribute` SET `attribute_code` = 'reference_amount' WHERE `eav_attribute`.`attribute_code` = 'base_amount';


I will not recommend to change any magneto default attribute code.

I hope it will help you!

Re: How to change EAV attribute_code on M1 to M2 migration?

Hi @Vimal Kumar 

 

thanks for your fast reply.

 

Isn't it possible to configure this in the mapping files? I guess this would be the cleaner solution.

Re: How to change EAV attribute_code on M1 to M2 migration?

Hi @thorsten_kleiba 

Just got your question Smiley Happy

Yes, you change while migration as well. Check the below magento documentation.

https://devdocs.magento.com/guides/v2.3/migration/migration-tool-configure.html

I hope it will help you!

Re: How to change EAV attribute_code on M1 to M2 migration?

Hi @Vimal Kumar 

 

I've studied this documentation for the last two days, but till now I havn't found a solution to my problem.

 

As far as I understand, i can rename tables and fields, move data from one field to another or convert data types on migration, which all are structural changes.

But what I need is technically speaking a change of the content, namely renaming the attribute_code in the eav_attribute table.

 

Is that possible too? If so, can you please give me an example?

Re: How to change EAV attribute_code on M1 to M2 migration?

@thorsten_kleiba I am also looking for it but without any positives yet.