I am getting following error while migrating sales data :
CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘updated_at’ at row 1. The SQL statement executed was: INSERT INTO `sales_order_item` (`order_id`, `weight`, `no_discount`, `qty_backordered`, `qty_canceled`, `qty_invoiced`, `qty_ordered`, `qty_refunded`, `qty_shipped`, `base_cost`, `price`, `base_price`, `tax_percent`, `tax_amount`, `base_tax_amount`, `tax_invoiced`, `base_tax_invoiced`, `discount_percent`, `discount_amount`, `base_discount_amount`, `discount_invoiced`, `base_discount_invoiced`, `amount_refunded`, `base_amount_refunded`, `row_total`, `base_row_total`, `row_invoiced`, `base_row_invoiced`, `row_weight`, `item_id`, `created_at`, `updated_at`, `product_id`, `product_options`, `sku`, `name`, `original_price`, `base_original_price`, `free_shipping`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, :yp22, :yp23, :yp24, :yp25, :yp26, :yp27, :yp28, :yp29, :yp30, :yp31, :yp32, :yp33, :yp34, :yp35, :yp36, :yp37, :yp38)
Please help in resolving
2 answers
H Hvohra,
Please help to confirm if the issue above associates with the same database that we replied to you on July 16 (via email)? If that is the case, our team can debug again based on such old instance to find a workaround.
Sincerely,
An Nguyen
Hi hvohra,
Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘updated_at’ at row 1. The SQL statement executed was: INSERT INTO `sales_order_item`
That issue because Magento 2 has new rule with `updated_at`filed in the table `sales_order_item`.
In M1: http://i.prntscr.com/2a1b764e32ee4c0cb6c1a6084bc65b88.png
But in M2: http://i.prntscr.com/f24ef20b5cac4d96a8e4fa63b9f387df.png
So, to solve the issue let’s run bellow sql command in your M1 database:
UPDATE `sales_flat_order_item` SET `updated_at` = NULL WHERE `updated_at` = '0000-00-00 00:00:00'
and make reset the step 7 and restart data migration in this step.
And tell me know how it goes.
Regards,
Mall.