cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062 Dupl

Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062 Dupl

Migrate from magento 1.9.2.3 to 2.3.5.-p1 how to solve the following error,

 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '21-product-details' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE'

 

Note: Settings migration successfully completed

6 REPLIES 6

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

Hi @Aveeva,

 

Can you please first cross check whether you have duplicate entries for the "product-details" keyword in database in eav_attribute_group.

 

If you dont have duplicate records then can you please try doing migration on fresh magento 2  database. Seems like you have tried migration multiple times.

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

Yes, in my database already available that column name?

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

Hi @Aveeva,

 

If you have duplicate entries then you need to delete entries and keep only one.

 

Thanks!

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

Hi @Aveeva 

Go to the location below and add the empty data condition to the Rule.php file. 

vendor/magento/module-sales-rule/Model/ResourceModel/Rule.php line 352

wrap it in

if (!empty($data)) {
    $connection->insertMultiple($this->getTable('salesrule_product_attribute'), $data);
}

After adding the condition, run the command below via SSH in the root of you Magento installation: php bin/magento setup:upgrade


It may help you!
Problem Solved? Please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

@Nishu Jindal  How to choose which values i need to delete, here attribute_set_id unique, help me thanks

 

Screenshot : https://snipboard.io/G9H0sb.jpg

 

FYI : https://snipboard.io/cQ7CpG.jpg

Re: Magento 2.3.5-p1 - Data migration error - SQLSTATE[23000]: Integrity constraint violation: 1062

Hi @Aveeva,

 

Did you try your data migration command with --reset parameter.?

I found something related to your issue: can you also try the same if possible.

https://magento.stackexchange.com/questions/258209/magento-2-how-can-i-reset-the-data-migration-tool

Thanks!