magento / data-migration-tool

Magento Data Migration Tool
https://devdocs.magento.com/guides/v2.3/migration/bk-migration-guide.html
Open Software License 3.0
338 stars 199 forks source link

Magento2 Migrating from M1 1.9.3.6 To M2 2.2.0 opensource to opensource #378

Closed AbdulKadir-Agoliya closed 7 years ago

AbdulKadir-Agoliya commented 7 years ago

I am attempting to migrate from 1.9.3.6 to 2.2.0 Opensource to opensource using the data migration tool. using command : php bin/magento migrate:setting /path-to/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.6/config.xml

start migration setting and there is one error source docuement is Source fields are not mapped. Document: core_website. Fields: mf_guid,created_at,updated_at i added ignore field statement

core_website.mf_guid core_website.updated_at core_website.created_at

in map-stores.xml

php bin/magento migrate:data -r /path-to/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.6/config.xml

Expected result

1.error should remove

  1. migration process to next step or proceed further

Actual result

1 . [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_at' in 'field list'

Also when i tried it using - -vvv param it give me

it give me this Exception trace: () at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:169 PDOStatement->execute() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:169 Migration\ResourceModel\Adapter\Mysql->insertMultiple() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:137 Migration\ResourceModel\Adapter\Mysql->insertRecords() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Destination.php:46 Migration\ResourceModel\Destination->saveRecords() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/Step/Settings/Data.php:137 Migration\Step\Settings\Data->perform() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php:73 Migration\Mode\AbstractMode->runStage() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/Mode/Settings.php:70 Migration\Mode\Settings->runData() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/Mode/Settings.php:34 Migration\Mode\Settings->run() at /home/mazelivingco/public_html/mag2/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php:51 Migration\Console\MigrateSettingsCommand->execute() at /home/mazelivingco/public_html/mag2/vendor/symfony/console/Command/Command.php:266 Symfony\Component\Console\Command\Command->run() at /home/mazelivingco/public_html/mag2/vendor/symfony/console/Application.php:875 Symfony\Component\Console\Application->doRunCommand() at /home/mazelivingco/public_html/mag2/vendor/symfony/console/Application.php:204 Symfony\Component\Console\Application->doRun() at /home/mazelivingco/public_html/mag2/vendor/magento/framework/Console/Cli.php:104 Magento\Framework\Console\Cli->doRun() at /home/mazelivingco/public_html/mag2/vendor/symfony/console/Application.php:122 Symfony\Component\Console\Application->run() at /home/mazelivingco/public_html/mag2/bin/magento:23

migrate:settings [-r|--reset] [-a|--auto] [--]

Now Please Suggest what to do next?

victor-v-rad commented 7 years ago

The problem you have is in core_config_data table which has fields were created by some extension. As quick fix i would suggest adding this code

            unset($sourceRecord['mf_guid']);
            unset($sourceRecord['updated_at']);
            unset($sourceRecord['created_at']);

right after foreach line

victor-v-rad commented 7 years ago

Internal ticket MAGETWO-80933 to fix it

AbdulKadir-Agoliya commented 7 years ago

Thank you so much its work For me issue Fixed

victor-v-rad commented 7 years ago

Great!

AbdulKadir-Agoliya commented 7 years ago

Can anyone help here Migrating from magento1.9.3.6 to magento2.2.0

I got this error

Array to string conversion in /var/www/html/magento220/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php on line 169

[Exception] Notice: Array to string conversion in /var/www/html/magento220/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.p hp on line 169

I see that file on line 169 i see this statement $statement->execute($bind);

protected function insertMultiple($documentName, $records) { $bind = []; $values = []; $colNum = count($records[0]); $fields = array_keys($records[0]); foreach ($records as $record) { foreach ($record as $value) { $bind[] = $value; } $values[] = '(' . implode(',', array_fill(0, $colNum, '?')) . ')'; } if ($values && $fields) { $insertSql = sprintf( 'INSERT INTO %s (%s) VALUES %s', $documentName, sprintf('%s', implode(',', $fields)), implode(',', $values) ); $statement = $this->resourceAdapter->getConnection()->prepare($insertSql); $statement->execute($bind); }

But i dont know how it works

migrate:data [-r|--reset] [-a|--auto] [--]

Please help me here its urgent and i have to finish it today

AbdulKadir-Agoliya commented 7 years ago

I have removed one module's column from M1's customer_group table and now that error gone

and now same error comes from sales_flat_order_item

so i think when migrate mode data , its not ignoring field

so please give me solution for that error come on data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php on line 169 $statement->execute($bind); function name insertMultiple($documentName, $records)

keanass commented 7 years ago

same issue here : from ce-to-ce 1.8 to 2.2 gives : vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php on line 169 must correct this please.