Note: I did data migration couple of times, during data migration max_allowd_packet issue then update and again run the data migration.
How to solve the php bin/magento setup:upgrade error, If i try to run upgrade command i am getting following error,
SQLSTATE: Integrity constraint violation: 1062 Duplicate entry '21' for key 'PRIMARY', query was: INSERT INTO eav_attribute_set (entity_type_id, attribute_set_name, sort_order, attribute_set_id) VALUES (?, ?, ?, ?)
Table : eav_attribute_set https://snipboard.io/rUicuR.jpg
How to solve this error?
In your case Edit that row, you will see there is more than 1 entry (here 21), just remove all other duplicates values from there and save it.
Flush cache and re-run index command.
php bin/magento cache:flush php bin/Magento indexer:reindex
Or you can take reference from below link:
It may help you!
Problem Solved? Please click on 'Accept as Solution!'
Please take a backup of your database first.
Then do suggested solutions. Yes you need to delete duplicate entries from table. Which is only way to resolve this issue.
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.
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!