update eav_attribute usa_attribute, com.eav_attribute com_attribute set usa_attribute.attribute_id = com_attribute.attribute_id where usa_attribute.entity_type_id = com_attribute.entity_type_id and usa_attribute.attribute_code = com_attribute.attribute_code Upholding foreign key constraints for table 'eav_attribute', entry '51', key 1 would lead to a duplicate entry Create Table: CREATE TABLE `eav_attribute` ( `attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Attribute Id', `entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Type Id', `attribute_code` varchar(255) NOT NULL COMMENT 'Attribute Code', `attribute_model` varchar(255) DEFAULT NULL COMMENT 'Attribute Model', `backend_model` varchar(255) DEFAULT NULL COMMENT 'Backend Model', `backend_type` varchar(8) NOT NULL DEFAULT 'static' COMMENT 'Backend Type', `backend_table` varchar(255) DEFAULT NULL COMMENT 'Backend Table', `frontend_model` varchar(255) DEFAULT NULL COMMENT 'Frontend Model', `frontend_input` varchar(50) DEFAULT NULL COMMENT 'Frontend Input', `frontend_label` varchar(255) DEFAULT NULL COMMENT 'Frontend Label', `frontend_class` varchar(255) DEFAULT NULL COMMENT 'Frontend Class', `source_model` varchar(255) DEFAULT NULL COMMENT 'Source Model', `is_required` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Defines Is Required', `is_user_defined` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Defines Is User Defined', `default_value` text COMMENT 'Default Value', `is_unique` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Defines Is Unique', `note` varchar(255) DEFAULT NULL COMMENT 'Note', PRIMARY KEY (`attribute_id`), UNIQUE KEY `UNQ_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE` (`entity_type_id`,`attribute_code`), KEY `IDX_EAV_ATTRIBUTE_ENTITY_TYPE_ID` (`entity_type_id`), CONSTRAINT `FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=212 DEFAULT CHARSET=utf8 COMMENT='Eav Attribute' 1 row in set (0.00 sec) mysql> select * from eav_attribute where attribute_id = 51; Empty set (0.00 sec) SELECT showing what I hope the update will achieve - cannot see how 51 could be a duplicate? select usa_attribute.attribute_id, usa_attribute.entity_type_id, usa_attribute.attribute_code, com_attribute.attribute_id, com_attribute.entity_type_id, com_attribute.attribute_code from eav_attribute usa_attribute left join com.eav_attribute com_attribute on ( usa_attribute.entity_type_id = com_attribute.entity_type_id and usa_attribute.attribute_code = com_attribute.attribute_code ); +--------------+----------------+--------------------------------+--------------+----------------+--------------------------------+ | attribute_id | entity_type_id | attribute_code | attribute_id | entity_type_id | attribute_code | +--------------+----------------+--------------------------------+--------------+----------------+--------------------------------+ | 615 | 1 | confirmation | 16 | 1 | confirmation | | 616 | 1 | created_at | 481 | 1 | created_at | | 602 | 1 | created_in | 3 | 1 | created_in | | 612 | 1 | default_billing | 13 | 1 | default_billing | | 613 | 1 | default_shipping | 14 | 1 | default_shipping | | 782 | 1 | disable_auto_group_change | 571 | 1 | disable_auto_group_change | | 610 | 1 | dob | 11 | 1 | dob | | 608 | 1 | email | 9 | 1 | email | | 604 | 1 | firstname | 5 | 1 | firstname | | 631 | 1 | gender | 480 | 1 | gender | | 609 | 1 | group_id | 10 | 1 | group_id | | 606 | 1 | lastname | 7 | 1 | lastname | | 605 | 1 | middlename | 6 | 1 | middlename | | 611 | 1 | password_hash | 12 | 1 | password_hash | | 603 | 1 | prefix | 4 | 1 | prefix | | 780 | 1 | rp_token | 569 | 1 | rp_token | | 781 | 1 | rp_token_created_at | 570 | 1 | rp_token_created_at | | 601 | 1 | store_id | 2 | 1 | store_id | | 607 | 1 | suffix | 8 | 1 | suffix | | 614 | 1 | taxvat | 15 | 1 | taxvat | | 600 | 1 | website_id | 1 | 1 | website_id | | 804 | 2 | care_of | 593 | 2 | care_of | | 624 | 2 | city | 24 | 2 | city | | 622 | 2 | company | 22 | 2 | company | | 625 | 2 | country_id | 25 | 2 | country_id | | 630 | 2 | fax | 30 | 2 | fax | | 618 | 2 | firstname | 18 | 2 | firstname | | 620 | 2 | lastname | 20 | 2 | lastname | | 619 | 2 | middlename | 19 | 2 | middlename | | 628 | 2 | postcode | 28 | 2 | postcode | | 617 | 2 | prefix | 17 | 2 | prefix | | 626 | 2 | region | 26 | 2 | region | | 627 | 2 | region_id | 27 | 2 | region_id | | 623 | 2 | street | 23 | 2 | street | | 621 | 2 | suffix | 21 | 2 | suffix | | 629 | 2 | telephone | 29 | 2 | telephone | | 783 | 2 | vat_id | 572 | 2 | vat_id | | 784 | 2 | vat_is_valid | 573 | 2 | vat_is_valid | | 786 | 2 | vat_request_date | 575 | 2 | vat_request_date | | 785 | 2 | vat_request_id | 574 | 2 | vat_request_id | | 787 | 2 | vat_request_success | 576 | 2 | vat_request_success | | 645 | 3 | all_children | 44 | 3 | all_children | | 657 | 3 | available_sort_by | 485 | 3 | available_sort_by | | 647 | 3 | children | 46 | 3 | children | | 656 | 3 | children_count | 55 | 3 | children_count | | 706 | 3 | custom_apply_to_products | 494 | 3 | custom_apply_to_products | | 649 | 3 | custom_design | 48 | 3 | custom_design | | 651 | 3 | custom_design_from | 50 | 3 | custom_design_from | | 652 | 3 | custom_design_to | 51 | 3 | custom_design_to | | 654 | 3 | custom_layout_update | 53 | 3 | custom_layout_update | | 705 | 3 | custom_use_parent_settings | 493 | 3 | custom_use_parent_settings | | 658 | 3 | default_sort_by | 486 | 3 | default_sort_by | | 635 | 3 | description | 34 | 3 | description | | 640 | 3 | display_mode | 39 | 3 | display_mode | | 707 | 3 | filter_price_range | 495 | 3 | filter_price_range | | 636 | 3 | image | 35 | 3 | image | | 704 | 3 | include_in_menu | 490 | 3 | include_in_menu | | 633 | 3 | is_active | 32 | 3 | is_active | | 642 | 3 | is_anchor | 41 | 3 | is_anchor | | 810 | 3 | is_spacer | 599 | 3 | is_spacer | | 641 | 3 | landing_page | 40 | 3 | landing_page | | 655 | 3 | level | 54 | 3 | level | | 639 | 3 | meta_description | 38 | 3 | meta_description | | 638 | 3 | meta_keywords | 37 | 3 | meta_keywords | | 637 | 3 | meta_title | 36 | 3 | meta_title | | 632 | 3 | name | 31 | 3 | name | | 653 | 3 | page_layout | 52 | 3 | page_layout | | 643 | 3 | path | 42 | 3 | path | | 646 | 3 | path_in_store | 45 | 3 | path_in_store | | 644 | 3 | position | 43 | 3 | position | | 719 | 3 | thumbnail | 568 | 3 | thumbnail | | 634 | 3 | url_key | 33 | 3 | url_key | | 648 | 3 | url_path | 47 | 3 | url_path | | 679 | 4 | color | 76 | 4 | color | | 772 | 4 | color_description | 469 | 4 | color_description | | 667 | 4 | cost | 64 | 4 | cost | | 788 | 4 | country_of_manufacture | 577 | 4 | country_of_manufacture | | 702 | 4 | created_at | 488 | 4 | created_at | | 691 | 4 | custom_design | 86 | 4 | custom_design | | 692 | 4 | custom_design_from | 87 | 4 | custom_design_from | | 693 | 4 | custom_design_to | 88 | 4 | custom_design_to | | 694 | 4 | custom_layout_update | 89 | 4 | custom_layout_update | | 660 | 4 | description | 57 | 4 | description | | 740 | 4 | e3ac01 | 539 | 4 | e3ac01 | | 741 | 4 | e3ac02 | 540 | 4 | e3ac02 | | 742 | 4 | e3ac03 | 541 | 4 | e3ac03 | | 743 | 4 | e3ac04 | 542 | 4 | e3ac04 | | 744 | 4 | e3ac05 | 543 | 4 | e3ac05 | | 745 | 4 | e3ac06 | 544 | 4 | e3ac06 | | 746 | 4 | e3ac07 | 545 | 4 | e3ac07 | | 747 | 4 | e3ac08 | 546 | 4 | e3ac08 | | 748 | 4 | e3ac09 | 547 | 4 | e3ac09 | | 730 | 4 | e3cdes | 456 | 4 | e3cdes | | 735 | 4 | e3col | 461 | 4 | e3col | | 725 | 4 | e3cono | 451 | 4 | e3cono | | 749 | 4 | e3cost | 548 | 4 | e3cost | | 731 | 4 | e3csds | 457 | 4 | e3csds | | 727 | 4 | e3des1 | 453 | 4 | e3des1 | | 728 | 4 | e3des2 | 454 | 4 | e3des2 | | 770 | 4 | e3hdee | NULL | NULL | NULL | | 733 | 4 | e3hdes | 459 | 4 | e3hdes | | 768 | 4 | e3hdeu | NULL | NULL | NULL | | 737 | 4 | e3hszn | 463 | 4 | e3hszn | | 750 | 4 | e3pc01 | 549 | 4 | e3pc01 | | 751 | 4 | e3pc02 | 550 | 4 | e3pc02 | | 752 | 4 | e3pc03 | 551 | 4 | e3pc03 | | 753 | 4 | e3pc04 | 552 | 4 | e3pc04 | | 739 | 4 | e3prgr | 466 | 4 | e3prgr | | 758 | 4 | e3ris1 | 553 | 4 | e3ris1 | | 759 | 4 | e3ris2 | 554 | 4 | e3ris2 | | 760 | 4 | e3ris3 | 555 | 4 | e3ris3 | | 761 | 4 | e3ris4 | 556 | 4 | e3ris4 | | 762 | 4 | e3rpr1 | 557 | 4 | e3rpr1 | | 763 | 4 | e3rpr2 | 558 | 4 | e3rpr2 | | 764 | 4 | e3rpr3 | 559 | 4 | e3rpr3 | | 765 | 4 | e3rpr4 | 560 | 4 | e3rpr4 | | 754 | 4 | e3rw1 | 561 | 4 | e3rw1 | | 755 | 4 | e3rw2 | 562 | 4 | e3rw2 | | 756 | 4 | e3rw3 | 563 | 4 | e3rw3 | | 757 | 4 | e3rw4 | 564 | 4 | e3rw4 | | 729 | 4 | e3sdes | 455 | 4 | e3sdes | | 726 | 4 | e3sku | 452 | 4 | e3sku | | 738 | 4 | e3stck | 465 | 4 | e3stck | | 734 | 4 | e3styl | 460 | 4 | e3styl | | 766 | 4 | e3usvt | 565 | 4 | e3usvt | | 769 | 4 | e3vdee | NULL | NULL | NULL | | 732 | 4 | e3vdes | 458 | 4 | e3vdes | | 767 | 4 | e3vdeu | NULL | NULL | NULL | | 736 | 4 | e3vszn | 462 | 4 | e3vszn | | 775 | 4 | extra | 538 | 4 | extra | | 773 | 4 | fabric_composition | 534 | 4 | fabric_composition | | 797 | 4 | fp_base_colour | 586 | 4 | fp_base_colour | | 805 | 4 | fp_category | 594 | 4 | fp_category | | 798 | 4 | fp_collection | 587 | 4 | fp_collection | | 807 | 4 | fp_concept | 596 | 4 | fp_concept | | 801 | 4 | fp_design | 590 | 4 | fp_design | | 806 | 4 | fp_gender | 595 | 4 | fp_gender | | 799 | 4 | fp_material | 588 | 4 | fp_material | | 808 | 4 | fp_product_group | 597 | 4 | fp_product_group | | 809 | 4 | fp_product_type | 598 | 4 | fp_product_type | | 802 | 4 | fp_size_type | 591 | 4 | fp_size_type | | 800 | 4 | fp_style | 589 | 4 | fp_style | | 682 | 4 | gallery | 79 | 4 | gallery | | 709 | 4 | gift_message_available | 445 | 4 | gift_message_available | | 792 | 4 | group_price | 581 | 4 | group_price | | 698 | 4 | has_options | 93 | 4 | has_options | | 774 | 4 | hero | 537 | 4 | hero | | 673 | 4 | image | 70 | 4 | image | | 699 | 4 | image_label | 482 | 4 | image_label | | 724 | 4 | is_imported | 533 | 4 | is_imported | | 688 | 4 | is_recurring | 491 | 4 | is_recurring | | 776 | 4 | keywords | 536 | 4 | keywords | | 778 | 4 | laurel_size | 567 | 4 | laurel_size | | 718 | 4 | links_exist | 524 | 4 | links_exist | | 715 | 4 | links_purchased_separately | 521 | 4 | links_purchased_separately | | 717 | 4 | links_title | 523 | 4 | links_title | | 669 | 4 | manufacturer | 66 | 4 | manufacturer | | 676 | 4 | media_gallery | 73 | 4 | media_gallery | | 672 | 4 | meta_description | 69 | 4 | meta_description | | 671 | 4 | meta_keyword | 68 | 4 | meta_keyword | | 670 | 4 | meta_title | 67 | 4 | meta_title | | 687 | 4 | minimal_price | 84 | 4 | minimal_price | | 791 | 4 | msrp | 580 | 4 | msrp | | 790 | 4 | msrp_display_actual_price_type | 579 | 4 | msrp_display_actual_price_type | | 789 | 4 | msrp_enabled | 578 | 4 | msrp_enabled | | 659 | 4 | name | 56 | 4 | name | | 680 | 4 | news_from_date | 77 | 4 | news_from_date | | 681 | 4 | news_to_date | 78 | 4 | news_to_date | | 677 | 4 | old_id | 74 | 4 | old_id | | 696 | 4 | options_container | 91 | 4 | options_container | | 695 | 4 | page_layout | 487 | 4 | page_layout | | 663 | 4 | price | 60 | 4 | price | | 710 | 4 | price_type | 446 | 4 | price_type | | 713 | 4 | price_view | 449 | 4 | price_view | | 689 | 4 | recurring_profile | 492 | 4 | recurring_profile | | 803 | 4 | rel | 592 | 4 | rel | | 697 | 4 | required_options | 92 | 4 | required_options | | 716 | 4 | samples_title | 522 | 4 | samples_title | | 714 | 4 | shipment_type | 450 | 4 | shipment_type | | 661 | 4 | short_description | 58 | 4 | short_description | | 771 | 4 | size | 468 | 4 | size | | 795 | 4 | size_footwear | 584 | 4 | size_footwear | | 796 | 4 | size_kids | 585 | 4 | size_kids | | 793 | 4 | size_men | 582 | 4 | size_men | | 794 | 4 | size_women | 583 | 4 | size_women | | 662 | 4 | sku | 59 | 4 | sku | | 711 | 4 | sku_type | 447 | 4 | sku_type | | 674 | 4 | small_image | 71 | 4 | small_image | | 700 | 4 | small_image_label | 483 | 4 | small_image_label | | 665 | 4 | special_from_date | 62 | 4 | special_from_date | | 779 | 4 | special_old_price | 566 | 4 | special_old_price | | 664 | 4 | special_price | 61 | 4 | special_price | | 666 | 4 | special_to_date | 63 | 4 | special_to_date | | 683 | 4 | status | 80 | 4 | status | | 684 | 4 | tax_class_id | 81 | 4 | tax_class_id | | 675 | 4 | thumbnail | 72 | 4 | thumbnail | | 701 | 4 | thumbnail_label | 484 | 4 | thumbnail_label | | 678 | 4 | tier_price | 75 | 4 | tier_price | | 703 | 4 | updated_at | 489 | 4 | updated_at | | 685 | 4 | url_key | 82 | 4 | url_key | | 686 | 4 | url_path | 83 | 4 | url_path | | 690 | 4 | visibility | 85 | 4 | visibility | | 777 | 4 | washable_instructions | 535 | 4 | washable_instructions | | 668 | 4 | weight | 65 | 4 | weight | | 712 | 4 | weight_type | 448 | 4 | weight_type | | 721 | 26 | address_result | 473 | 26 | address_result | | 723 | 26 | cv2_result | 475 | 26 | cv2_result | | 720 | 26 | parent_id | 472 | 26 | parent_id | | 722 | 26 | postcode_result | 474 | 26 | postcode_result | +--------------+----------------+--------------------------------+--------------+----------------+--------------------------------+