cancel
Showing results for 
Search instead for 
Did you mean: 

data-migration-tool Integrity constraint violation: 1062 Duplicate entry '12-general-information

data-migration-tool Integrity constraint violation: 1062 Duplicate entry '12-general-information

I'm trying to migrate my site from M1.9.4.5 to M2.4.3-p1 and facing an error during the EAV step.

 

/httpdocs$ m2 migrate:data -a -vvv -- app/code/Ioweb/Migration/etc/opensource-to-opensource/1.9.4.5/config.xml

[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: Data Integrity Step]: started
[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: EAV Step]: started
[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-01-04 11:01:17][WARNING]: Destination fields are not mapped. Document: customer_entity. Fields: session_cutoff
[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: Map Step]: started
[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
[2022-01-04 11:01:17][INFO][mode: data][stage: integrity check][step: Log Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-01-04 11:01:18][WARNING]: Destination fields are not mapped. Document: customer_visitor. Fields: created_at
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: integrity check][step: Inventory Step]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: setup triggers][step: Stage]: started
[2022-01-04 11:01:18][INFO][mode: data][stage: data migration][step: EAV Step]: started
57% [================>-----------] Remaining Time: < 1 sec
In Mysql.php line 182:

[PDOException (23000)]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12-general-information' fo
r key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE'


Exception trace:
at /httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
PDOStatement->execute() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
Migration\ResourceModel\Adapter\Mysql->insertMultiple() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:148
Migration\ResourceModel\Adapter\Mysql->insertRecords() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Destination.php:52
Migration\ResourceModel\Destination->saveRecords() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:597
Migration\Step\Eav\Data->saveRecords() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:395
Migration\Step\Eav\Data->migrateAttributeGroups() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:361
Migration\Step\Eav\Data->migrateCustomAttributeGroups() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:180
Migration\Step\Eav\Data->perform() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php:82
Migration\Mode\AbstractMode->runStage() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:124
Migration\Mode\Data->runData() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:69
Migration\Mode\Data->run() at /httpdocs/vendor/magento/data-migration-tool/src/Migration/Console/MigrateDataCommand.php:59
Migration\Console\MigrateDataCommand->execute() at /httpdocs/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /httpdocs/vendor/magento/framework/Interception/Interceptor.php:58
Migration\Console\MigrateDataCommand\Interceptor->___callParent() at /httpdocs/vendor/magento/framework/Interception/Interceptor.php:138
Migration\Console\MigrateDataCommand\Interceptor->Magento\Framework\Interception\{closure}() at /httpdocs/vendor/magento/framework/Interception/Interceptor.php:153
Migration\Console\MigrateDataCommand\Interceptor->___callPlugins() at /httpdocs/generated/code/Migration/Console/MigrateDataCommand/Interceptor.php:77
Migration\Console\MigrateDataCommand\Interceptor->run() at /httpdocs/vendor/symfony/console/Application.php:1009
Symfony\Component\Console\Application->doRunCommand() at /httpdocs/vendor/symfony/console/Application.php:273
Symfony\Component\Console\Application->doRun() at /httpdocs/vendor/magento/framework/Console/Cli.php:115
Magento\Framework\Console\Cli->doRun() at /httpdocs/vendor/symfony/console/Application.php:149
Symfony\Component\Console\Application->run() at /httpdocs/bin/magento:23

 

 

 

I'm not sure why this error appears. On M1 I see that the attribute group "General Information" only appears once in the database

 

 

+------------------+----------------+--------------------+----------+----------+
|attribute_group_id|attribute_set_id|attribute_group_name|sort_order|default_id|
+------------------+----------------+--------------------+----------+----------+
|1                 |1               |General             |4         |1         |
|2                 |2               |General             |4         |1         |
|3                 |3               |General             |4         |1         |
|4                 |9               |General             |1         |1         |
|7                 |12              |General Information |10        |1         |
|17                |23              |General             |3         |1         |
|18                |24              |General             |3         |1         |
|19                |25              |General             |3         |1         |
|20                |26              |General             |3         |1         |
|21                |27              |General             |3         |1         |
|22                |28              |General             |3         |1         |
|23                |18              |General             |2         |1         |
|24                |20              |General             |2         |1         |
|25                |21              |General             |2         |1         |
|26                |22              |General             |2         |1         |
|27                |29              |General             |3         |1         |
|28                |30              |General             |3         |1         |
|29                |31              |General             |3         |1         |
|30                |32              |General             |3         |1         |
|31                |33              |General             |3         |1         |
|32                |34              |General             |3         |1         |
|47                |38              |General             |1         |1         |
|51                |39              |General             |43        |1         |
|55                |40              |General             |1         |1         |
|59                |41              |General             |1         |1         |
|63                |42              |General             |43        |1         |
|72                |44              |General             |7         |1         |
|80                |45              |General             |1         |1         |
|96                |46              |General             |1         |1         |
|128               |50              |General             |1         |1         |
|129               |51              |General             |1         |1         |
|130               |52              |General             |1         |1         |
|131               |53              |General             |1         |1         |
|132               |54              |General             |1         |1         |
|133               |55              |General             |1         |1         |
|134               |56              |General             |1         |1         |
|135               |57              |General             |1         |1         |
|136               |58              |General             |1         |1         |
|142               |59              |General             |1         |1         |
|148               |60              |General             |1         |1         |
|154               |61              |General             |43        |1         |
|160               |62              |General             |1         |1         |
+------------------+----------------+--------------------+----------+----------+

I'm not sure how to proceed and what the actual error is. Any ideas what I should look into?

3 REPLIES 3

Re: data-migration-tool Integrity constraint violation: 1062 Duplicate entry '12-general-information

logging into the GRCC blackboard are outlined below.

Re: data-migration-tool Integrity constraint violation: 1062 Duplicate entry '12-general-information

The message means you are doing another insert with the same combination of columns that are part of the IDX_STOCK_PRODUCT, which seems to be defined as UNIQUE. If it is so, it doesn't allow to enter the same combination (it seems like it consists of two fields) twice.

If you are inserting records, make sure you are picking a brand new record id or that the combination of the record id and the other column is unique.

Without a detailed table structure and your code, we can hardly guess what's going wrong.

If issue solved, Click Kudos & Accept as Solution.
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool

Re: data-migration-tool Integrity constraint violation: 1062 Duplicate entry '12-general-information

Hi, thanks for trying to help.

 

As I've posted above, it's the standard data-migration-tool from Magento repo. The code is in the github repo. No customizations on our side whatsoever.

 

As for the unique restriction, it's trying to do this for the index

EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE

Which is in the standard M2 database table eav_attribute_group, which forces only one combination of attribute_set_id and attribute_group_code to exist.

The problem is that for some reason, the data migration tool is trying to insert the same combination twice but there is no duplication on the original M1 database. Somewhere, the data migration tool is doing something wrong but with no clarification of where.

 

That's why I'm puzzled.