Magento – Integrity constraint violation: 1062 Duplicate entry ‘0’ for key ‘PRIMARY’

datamigration

I'm trying to migrate from Magento 1 to 2 and when I get to this part:

[2017-10-06 14:04:36][INFO][mode: data][stage: data migration][step: Map Step]: started
33% [=========>——————] Remaining Time: 3 mins

I then get this error

[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

Any ideas?

Best Answer

The problem should go away if you change bulk_size to something other than 0 in your config.xml. It doesn't seem to auto-detect correctly on the customer_group table. Setting mine to 100 solved the problem for me.

To find out what table is the problem, try adding some debugging info to your src/Migration/Step/Map/Data.php file. Something like $this->logger->info("DEBUG: " . $sourceDocName ); around line 136 (in the perform() method, first thing within the first foreach loop). This should output the table the migration tool is currently working on in the console.

Related Topic