2

We are trying to migrate Magento 1.9.2.0 to Magento 2.0.4 EE. We have added the missing tables and columns in M2 Database and then started running the below command.

php bin/magento migrate:data vendor/magento/data-migration-tool/etc/ce-to-ee/1.9.2.0/config.xml.dist

[2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: EAV Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Map Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Log Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Ratings Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: setup triggers][step: Stage]: started [2016-04-13 13:30:05][INFO][mode: data][stage: data migration][step: EAV Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: volume check][step: EAV Step]: started [2016-04-13 13:30:05][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started 0% [>---------------------------] Remaining Time:

Please anyone can help.

4
  • plz show error display in cmd so we can figure out it and also migrate log are generated those file errors are show to solve issue. Commented Apr 14, 2016 at 5:46
  • @Rakesh where can I see the logs generated..
    – amit
    Commented Apr 14, 2016 at 7:31
  • inside var/migration folder Commented Apr 14, 2016 at 7:35
  • We have add little code in Migration/Step/Customer/Data.php in perform function after this line"$destinationRecords->addRecord($destRecord);" and the code is if ($count >= 5) { $count = 0; break; }. After this we executed migration command it started migrating the customer.
    – amit
    Commented Apr 14, 2016 at 7:43

2 Answers 2

0

Try disabling the customer hash in the config.xml file.

<upgrade_customer_password_hash>0</upgrade_customer_password_hash>
0

I know this is an old question, but if you're still having issues with Customer Attributes getting stuck at 0 or 16% (common numbers I've seen and had issues with myself), I've made a quick fix for it. The problem is if you have 25k+ customers in your Magento 1 instance. In our case, we have over 300,000, so it's just too much data for php and mysql to process all at once as it attempts to save. It seems to cap out for me around 50k and then stop itself from processing anything.

Version: 2.0.7 is what we are using currently of the migration tool, 2.0.8 of Mage2 (confirmed working with 2.0.7 by Enterprise Support)

EDIT - Official fix in pull request but not in new release yet here: https://github.com/magento-nord/data-migration-tool/pull/1/commits/6949dfe5ec425c78da162ca1003f0d377939c407

Edit: vendor/magento/data-migration-tool/src/Migration/Step/Customer/Data.php ~ Line 142

while (!empty($bulk = $this->source->getRecords($sourceDocName, $pageNumber))) {
$pageNumber++;

$destinationRecords = $destDocument->getRecords();
foreach ($bulk as $recordData) {
    $this->source->setLastLoadedRecord($sourceDocName, $recordData);
    if ($this->helper->isSkipRecord($attributeType, $sourceDocName, $recordData)) {
        continue;
    }
    /** @var Record $record */
    $record = $this->recordFactory->create(['document' => $sourceDocument, 'data' => $recordData]);
    /** @var Record $destRecord */
    $destRecord = $this->recordFactory->create(['document' => $destDocument]);
    $recordTransformer->transform($record, $destRecord);
    $destinationRecords->addRecord($destRecord);
}
$this->progress->advance(LogManager::LOG_LEVEL_INFO);
$this->progress->advance(LogManager::LOG_LEVEL_DEBUG);

$this->helper->updateAttributeData($attributeType, $sourceDocName, $destinationRecords);

$this->destination->saveRecords($destinationName, $destinationRecords);

}

Make changes to this, and add in a count for blocks that your server/machine can handle. I did blocks of 1000 just for timeout sake.

while (!empty($bulk = $this->source->getRecords($sourceDocName, $pageNumber))) {
$pageNumber++;

$destinationRecords = $destDocument->getRecords();
$count = 0; // ++ Added within the while loop to continue processing
foreach ($bulk as $recordData) {
    if($count > 1000) // ++
    { // ++
        break; // ++
    } // ++
    $this->source->setLastLoadedRecord($sourceDocName, $recordData);
    if ($this->helper->isSkipRecord($attributeType, $sourceDocName, $recordData)) {
        continue;
    }
    /** @var Record $record */
    $record = $this->recordFactory->create(['document' => $sourceDocument, 'data' => $recordData]);
    /** @var Record $destRecord */
    $destRecord = $this->recordFactory->create(['document' => $destDocument]);
    $recordTransformer->transform($record, $destRecord);
    $destinationRecords->addRecord($destRecord);
    $count++; // ++
}
$this->progress->advance(LogManager::LOG_LEVEL_INFO);
$this->progress->advance(LogManager::LOG_LEVEL_DEBUG);

$this->helper->updateAttributeData($attributeType, $sourceDocName, $destinationRecords);

$this->destination->saveRecords($destinationName, $destinationRecords);

}

1
  • What about the page number. Wouldn't this approach result in loss of data and implicit corrupted database? You can see that the page number counts when loading the records. Sure u break the cycle when your count reaches 1000 but the page increments even though not all records from that page were processed. (Hint the break). I believe that the page count effects which records are loaded and thus this will result in lost records. Commented Jan 25, 2018 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.