Anyone having this issue?
data migration > EAV Step
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-Migration_Default' for key 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'
Anyone having this issue?
data migration > EAV Step
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-Migration_Default' for key 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'
This error occurs when the migration tool fails to transfer data (e.g. due to integrity violations) without rolling back, and is ran again. It attempts to create "Migration_Default" attribute set and fails, because it already is present in the database.
What you have to do is to:
1) Restore your Magento 2.0 database from a copy that you (hopefully) made before running the migration tool.
2) Run the migration tool again and check for the first error that it fails on. In my case it was:
[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'home-1' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'
3) Fix the problem (I had to manually remove a row in the DB).
Repeat the steps until you've cleared all errors and see the sweet sounding message:
Migration completed
I found this solution that solved this issue for me https://github.com/magento/data-migration-tool/issues/235#issuecomment-321923437
Solution is to rename all values containing the name "Default" in "attribute_value_name" field of eav_attribute_set table to "Default_x" in the Magento 1 database and run the migration from scratch.
In my case, there were 9 records with name "Default". So I renamed them to Default_1 to Default_9 and it worked perfectly!
EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE
, and resolved that by a similar approach: UPDATE eav_attribute_group SET attribute_group_name = CONCAT(attribute_group_name, "_", attribute_set_id) WHERE attribute_group_name = "General";
In my case: It happened to me and I had to import a backup of my magento 2 database before reloading migration.
At your case: Maybe you had to reload data migration a second time.
To fix this issue,
You can do that through your SQL querying application or interface.
DELETE FROM eav_attribute_set WHERE attribute_set_name != 'Default';
Double check with your migrating Database Magento 2. Sometimes We didn't change the database name in the data migrating tool.
Reinstall fresh Magento instance and correctly add database name in data migrating tool
Data-Migration-Tool does not receive data from the source in utf8.
Here is a simple solution to this problem:
Edit: vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php
public function __construct(
\Magento\Framework\DB\Adapter\Pdo\MysqlFactory $adapterFactory,
\Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory,
array $config
) {
$config['initStatements'] = 'SET NAMES utf8'; // +
$configData['config'] = $config;
$this->resourceAdapter = $adapterFactory->create($configData);
$this->setForeignKeyChecks(0);
$this->triggerFactory = $triggerFactory;
}
In my experience, there is sample data installed. So, i have done the following steps.
Then, I can migrate.
Fixed my issue with following sql:
Integrity constraint violation: 1062 Duplicate entry ‘4-Images’ for key – Magento 2
delete from eav_attribute_group WHERE attribute_group_name = 'Images';
So try something
delete from eav_attribute_group WHERE attribute_group_name = 'Home';