step 3 Integrity constraint violation: 1062 Duplic

Hi
When running step 3 we see the following error:

-bash-4.2$ php -dmemory_limit=1G bin/ubdatamigration run --step=3
[Processing][run] in step #3: ............
[Processing][run] Step #3 migration completed with 12 Attribute Sets
....................................................................................................
[Processing][run] Step #3 migration completed with 100 Attribute Groups
........
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '23-product-details' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE'. The SQL statement executed was: INSERT INTO `eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)

Any ides?

1 answer

Profile photo of Mall Staff 184060.00 $tone July 6, 2020
Public

Hi there,
I am sorry for replying to you this late as we’ve just been back from our weekend. 

Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ’23-product-details’ for key ‘EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE’. The SQL statement executed was: INSERT INTO `eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)

That issue occurred because your M1 database had a special case of attribute groups naming in one product Attribute Set.

Please try with these steps to solve that case:
+ Open the PHP file at pub/ub-tool/protected/controllers/Step3Controller.php
and find the code line:

$attributeGroupCode2 = (preg_match("/(general)/i", $attributeGroupCode2)) ? 'product-details' : $attributeGroupCode2;

and replace it with:

//$attributeGroupCode2 = (preg_match("/(general)/i", $attributeGroupCode2)) ? 'product-details' : $attributeGroupCode2;

+ Once done, you can continue with the data migration in step #3 as normal.

Regards,
Mall.

#1

Please login or Register to Submit Answer

Written By

Comments