cancel
Showing results for 
Search instead for 
Did you mean: 

Data migration M1 to M2 issues Duplicate Entry 9-images

Highlighted

Data migration M1 to M2 issues Duplicate Entry 9-images

Hello, We are doing data migration but getting below error. Could anyone please suggest a way.

M1 Version: 1.9.3.2

M2 Version: 2.3.5

 

In Mysql.php line 182:
[PDOException (23000)]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-Images' for key
'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_
GROUP_NAME'
OR
In Mysql.php line 182:
[PDOException (23000)]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '68-meta-information'
for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID

_ATTRIBUTE_GROUP_CODE'

Exception trace:
at /var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
PDOStatement-&gt;execute() at /var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
Migration\ResourceModel\Adapter\Mysql-&gt;insertMultiple() at
/var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/ResourceModel/Adapter/Mysql.php:148
Migration\ResourceModel\Adapter\Mysql-&gt;insertRecords() at
/var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/ResourceModel/Destination.php:52
Migration\ResourceModel\Destination-&gt;saveRecords() at
/var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/Step/Eav/Data.php:586
Migration\Step\Eav\Data-&gt;saveRecords() at /var/www/html/<project>/vendor/magento/data-
migration-tool/src/Migration/Step/Eav/Data.php:318
Migration\Step\Eav\Data-&gt;createProductAttributeSetStructures() at
/var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/Step/Eav/Data.php:179
Migration\Step\Eav\Data-&gt;perform() at /var/www/html/<project>/vendor/magento/data-
migration-tool/src/Migration/Mode/AbstractMode.php:82
Migration\Mode\AbstractMode-&gt;runStage() at /var/www/html/<project>/vendor/magento/data-
migration-tool/src/Migration/Mode/Data.php:124
Migration\Mode\Data-&gt;runData() at /var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/Mode/Data.php:69
Migration\Mode\Data-&gt;run() at /var/www/html/<project>/vendor/magento/data-migration-
tool/src/Migration/Console/MigrateDataCommand.php:59
Migration\Console\MigrateDataCommand-&gt;execute() at
/var/www/html/<project>/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command-&gt;run() at
/var/www/html/<project>/vendor/magento/framework/Interception/Interceptor.php:58
Migration\Console\MigrateDataCommand\Interceptor-&gt;___callParent() at
/var/www/html/<project>/vendor/magento/framework/Interception/Interceptor.php:138
Migration\Console\MigrateDataCommand\Interceptor-
&gt;Magento\Framework\Interception\{closure}() at
/var/www/html/<project>/vendor/magento/framework/Interception/Interceptor.php:153
Migration\Console\MigrateDataCommand\Interceptor-&gt;___callPlugins() at
/var/www/html/<project>/generated/code/Migration/Console/MigrateDataCommand/Interceptor.p
hp:104
Migration\Console\MigrateDataCommand\Interceptor-&gt;run() at
/var/www/html/<project>/vendor/symfony/console/Application.php:1000

Symfony\Component\Console\Application-&gt;doRunCommand() at
/var/www/html/<project>/vendor/symfony/console/Application.php:271
Symfony\Component\Console\Application-&gt;doRun() at
/var/www/html/<project>/vendor/magento/framework/Console/Cli.php:115
Magento\Framework\Console\Cli-&gt;doRun() at
/var/www/html/<project>/vendor/symfony/console/Application.php:147
Symfony\Component\Console\Application-&gt;run() at /var/www/html/<project>/bin/magento:23

9 REPLIES 9
Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@ram1ranosy60db 

 

Just run below queries in Magento 1 database

 

DELETE FROM eav_attribute_set WHERE entity_type_id NOT IN (SELECT entity_type_id FROM eav_entity_type);
DELETE FROM eav_entity_attribute WHERE attribute_group_id NOT IN (SELECT attribute_group_id FROM eav_attribute_group);
DELETE FROM catalog_eav_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);

Take a back up before running these.

 

Run migration command with -vvv to know detailed error:

php -dmemory_limit=-1 bin/magento migrate:data -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.8.1.0/config.xml -vvv

Manish Mittal
https://www.manishmittal.com/
Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@Manish Mittal Thanks, Getting this error now.

 

[PDOException (23000)]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '68-product-details' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_A
  TTRIBUTE_GROUP_CODE

Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@ram1ranosy60db 

 

Run below queries:

SELECT * FROM eav_entity_attribute WHERE attribute_group_id NOT IN (SELECT attribute_group_id FROM eav_attribute_group);
SELECT * FROM catalog_eav_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
SELECT * FROM catalog_eav_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);

All should return empty results.

 

if any query having records you should delete. 

and then again run migration but make sure M2 DB should be fresh again, do not run in existing one where you got error. Thanks

Manish Mittal
https://www.manishmittal.com/
Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@Manish Mittal , Giving empty results on M1 db but on fresh M2 database again giving same 9-image issue.

Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@ram1ranosy60db 

 

Can you run command with -vvv  in the last of command just append this so it will give error in details or in which table we have duplicate entry. 

Manish Mittal
https://www.manishmittal.com/
Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@Manish Mittal

 

we have used -vvv and getting this error in EAV step:

 

[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: Log Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: integrity check][step: Inventory Step]: started
[2020-07-24 09:47:41][INFO][mode: data][stage: setup triggers][step: Stage]: started
[2020-07-24 09:47:41][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 '9-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_G
ROUP_NAME'

Exception trace:
at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
PDOStatement->execute() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:182
Migration\ResourceModel\Adapter\Mysql->insertMultiple() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:148
Migration\ResourceModel\Adapter\Mysql->insertRecords() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Destination.php:52
Migration\ResourceModel\Destination->saveRecords() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:587
Migration\Step\Eav\Data->saveRecords() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:393
Migration\Step\Eav\Data->migrateAttributeGroups() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:359
Migration\Step\Eav\Data->migrateCustomProductAttributeGroups() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php:180
Migration\Step\Eav\Data->perform() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php:82
Migration\Mode\AbstractMode->runStage() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:124
Migration\Mode\Data->runData() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:69
Migration\Mode\Data->run() at /var/www/html/boatparts/vendor/magento/data-migration-tool/src/Migration/Console/MigrateDataCommand.php:59
Migration\Console\MigrateDataCommand->execute() at /var/www/html/boatparts/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/html/boatparts/vendor/magento/framework/Interception/Interceptor.php:58
Migration\Console\MigrateDataCommand\Interceptor->___callParent() at /var/www/html/boatparts/vendor/magento/framework/Interception/Interceptor.php:138
Migration\Console\MigrateDataCommand\Interceptor->Magento\Framework\Interception\{closure}() at /var/www/html/boatparts/vendor/magento/framework/Interception/Interceptor.php:153
Migration\Console\MigrateDataCommand\Interceptor->___callPlugins() at /var/www/html/boatparts/generated/code/Migration/Console/MigrateDataCommand/Interceptor.php:26
Migration\Console\MigrateDataCommand\Interceptor->run() at /var/www/html/boatparts/vendor/symfony/console/Application.php:1000
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/boatparts/vendor/symfony/console/Application.php:271
Symfony\Component\Console\Application->doRun() at /var/www/html/boatparts/vendor/magento/framework/Console/Cli.php:115
Magento\Framework\Console\Cli->doRun() at /var/www/html/boatparts/vendor/symfony/console/Application.php:147
Symfony\Component\Console\Application->run() at /var/www/html/boatparts/bin/magento:23

migrate:data [-r|--reset] [-a|--auto] [--] <config>

 

 

Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@ram1ranosy60db 

Here error is:

 

[PDOException (23000)]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_G
ROUP_NAME'

 

check duplicate entry  '9-Images' for this key: EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_G
ROUP_NAME 

 

You will find this key in eav_attribute_group table which is related to attribute_set_id and attribute group name.

 

You have to just find/delete duplicate entry and re run again migration command in fresh DB.

Manish Mittal
https://www.manishmittal.com/
Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@Manish Mittal

 

As i can see in M1 database there is only one entry related to 9-Images as 9 being attribute_set_id and Images being attribute_group_name in eav_attribute_group table. There are also 68-Images and 69-Images present in the table.

 

Can you suggest in this.

Highlighted

Re: Data migration M1 to M2 issues Duplicate Entry 9-images

@ram1ranosy60db 

 

That only has to debug then, this is just duplicate issue either group name, attribute set id.

 

Or it might be these values already exists in M2 database.

Manish Mittal
https://www.manishmittal.com/