Facing error while sync latest records from M1

Hi Support Team,
We are using your UB Data Migration Pro (CE) — 3.2.0 to migrate data from Magento1.7 to Magento2.3.1 for our website.
We have migrated the data using UB theme 8 months ago, and now we need to update the latest records from Magento 1.7 to our instance Magento 2.3.1 again for the latest sync.
While migrating the records as per the steps in admin, we are facing the below mentioned errors.
Implementation 1 -- Our Magento 2.3.1 instance(Already migrated website 8 months ago):
We tried to run all steps in admin and the first two steps are finished without facing any issues. For 3rd step, the process is taking almost 2 days but it couldn’t complete it and the percentage of progress shows as 14% only.
Then we stopped the process in admin and tried to run commands using Command Line Interface(CLI) which is also getting the error mentioned below.
[Processing][run] in step #3: ..PHP Error[2]: get_class() expects parameter 1 to be object, null given in file /var/www/html/stuartnew/pub/ub-tool/protected/controllers/Step3Controller.php at line 388
We are not able to move next step without completing Step3.
Meanwhile we have started migrating the same records in a fresh magento instance 2.3.1, just for testing the behaviour.
Implementation 2 (Demo site of Magento 2.3.1):
We have created a new fresh instance with Magento2.3.1 and installed the UB Data Migration Pro (CE) — 3.2.0 for migration process.
The migration settings are given correctly in the admin and we started the migration process by clicking run all steps. All steps are migrated except sales(Step7), here also we got error as below:
Message: Mage2SalesQuote: Items Qty is too long (maximum is 12 characters).
— Base Subtotal With Discount is too long (maximum is 12 characters).
We noticed that the pervious error that we got in the Step3 (Implementation 1) is not showing in new instance and we are facing two different issues in two different instances.
As this is of high priority, kindly help us at the earliest to resolve the issue in our M2.3.1 instance. We need to do a latest sync of records in our site and its quite urgent. Please advise.

11 answers

Profile photo of Mall Staff 148890.00 $tone 6 days ago
Public

Hi there,

[Processing][run] in step #3: ..PHP Error[2]: get_class() expects parameter 1 to be object, null given in file /var/www/html/stuartnew/pub/ub-tool/protected/controllers/Step3Controller.php at line 388

It seems that you deleted at least one migrated Attribute Set in M2 after the first migration. To solve that issue you can try with these steps:

1. Run the following SQL queries in your M2 database:

DELETE FROM ub_migrate_map_step_3 WHERE entity_name = 'eav_attribute_set' AND m2_id NOT IN (SELECT attribute_set_id FROM eav_attribute_set);
DELETE FROM ub_migrate_map_step_3 WHERE entity_name = 'eav_attribute_group' AND m2_id NOT IN (SELECT attribute_group_id FROM eav_attribute_group);
DELETE FROM ub_migrate_map_step_3_attribute WHERE entity_name = 'eav_attribute' AND m2_id NOT IN (SELECT attribute_id FROM eav_attribute);
DELETE FROM ub_migrate_map_step_3_attribute_option WHERE entity_name = 'eav_attribute_option' AND m2_id NOT IN (SELECT option_id FROM eav_attribute_option);

2. Clean the cache of our module by running the command:
rm -rf pub/ub-tool/protected/runtime/cache/
3. You continue with data migration in step #3 by running the CLI command:

php -f bin/ubdatamigration run --step=3;

Message: Mage2SalesQuote: Items Qty is too long (maximum is 12 characters).
— Base Subtotal With Discount is too long (maximum is 12 characters).

Those referred to bad data cases. And such cases were already handled the Pro v3.2.0. I didn’t know why you still get those issues.
Please provide me information about your instance:

  • URL and Admin credentials of your M2 instance
  • SSH credentials of your M2 instance
  • And let me know the path to the M2 folder

I will help to check further and get back to you then.
PS. Please make sure you mark your reply private or simply switch this ticket to the private mode. Then only you and our technical team can access it. 

Regards,
Mall.
 
 

#1
Profile photo of lakvenkat 700.00 $tone 6 days ago
Public

Hi Mall,
We followed the steps which are given by you and the addressed issue is resolved, but we getting another issue in step6.
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘4468’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `customer_entity` (`group_id`, `store_id`, `is_active`, `disable_auto_group_change`, `failures_num`, `entity_id`, `website_id`, `email`, `created_at`, `updated_at`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9)
Can you please help in fixing this issue.

#2
Profile photo of Mall Staff 148890.00 $tone 6 days ago
Public

Hi there,

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘4468’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `customer_entity` (`group_id`, `store_id`, `is_active`,

To solve that issue, you can do steps as follows:

1. Run the following SQL queries in your M2 database:

Delete From customer_group Where customer_group_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_group');
Delete From tax_class Where class_type='CUSTOMER' AND class_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'tax_class');
Delete From customer_entity Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');
Delete From customer_entity_varchar Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');
Delete From customer_entity_text Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');
Delete From customer_entity_int Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');
Delete From customer_entity_decimal Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');
Delete From customer_entity_datetime Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_6 where entity_name = 'customer_entity');

2. And then, you continue with the data migration in step #6.

Regards,
Mall.

#3
Profile photo of lakvenkat 700.00 $tone 5 days ago
Public

Hi Mall,
Thanks for your quick response.
The issue got resolved in step6, now we are getting the same type of error while running step7.
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1625’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_order` (`total_item_count`, `paypal_ipn_customer_notified`, `fee`, `base_fee`, `entity_id`, `state`, `status`, `protect_code`, `shipping_description`, `is_virtual`, `store_id`, `customer_id`, `base_discount_amount`, `base_discount_invoiced`, `base_grand_total`, `base_shipping_amount`, `base_shipping_invoiced`, `base_shipping_tax_amount`, `base_subtotal`, `base_subtotal_invoiced`, `base_tax_amount`, `base_tax_invoiced`, `base_to_global_rate`, `base_to_order_rate`, `base_total_invoiced`, `base_total_invoiced_cost`, `base_total_paid`, `discount_amount`, `discount_invoiced`, `grand_total`, `shipping_amount`, `shipping_invoiced`, `shipping_tax_amount`, `store_to_base_rate`, `store_to_order_rate`, `subtotal`, `subtotal_invoiced`, `tax_amount`, `tax_invoiced`, `total_invoiced`, `total_paid`, `total_qty_ordered`, `customer_is_guest`, `customer_note_notify`, `billing_address_id`, `customer_group_id`, `email_sent`, `quote_id`, `shipping_address_id`, `base_shipping_discount_amount`, `base_subtotal_incl_tax`, `base_total_due`, `shipping_discount_amount`, `subtotal_incl_tax`, `total_due`, `weight`, `increment_id`, `base_currency_code`, `customer_email`, `customer_firstname`, `customer_lastname`, `global_currency_code`, `order_currency_code`, `remote_ip`, `shipping_method`, `store_currency_code`, `store_name`, `created_at`, `updated_at`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `base_shipping_discount_tax_compensation_amnt`, `discount_tax_compensation_invoiced`, `base_discount_tax_compensation_invoiced`, `shipping_incl_tax`, `base_shipping_incl_tax`) 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, :yp39, :yp40, :yp41, :yp42, :yp43, :yp44, :yp45, :yp46, :yp47, :yp48, :yp49, :yp50, :yp51, :yp52, :yp53, :yp54, :yp55, :yp56, :yp57, :yp58, :yp59, :yp60, :yp61, :yp62, :yp63, :yp64, :yp65, :yp66, :yp67, :yp68, :yp69, :yp70, :yp71, :yp72, :yp73, :yp74, :yp75, :yp76)
Can you please check and resolve this?

#4
Profile photo of Mall Staff 148890.00 $tone 5 days ago
Public

Hi there,

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1625’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_order` (`total_item_count`, `paypal_ipn_customer_notified`, `fee`,

To solve that issue, you can try with these steps:

1. Run the following SQL queries in your M2 database:

Delete From salesrule Where rule_id NOT IN (Select m2_id From ub_migrate_map_step_7 where entity_name = 'salesrule');
Delete From quote Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote where entity_name = 'sales_flat_quote' OR entity_name = 'sales_flat_quote_active');
Delete From quote_item Where item_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote_item where entity_name = 'sales_flat_quote_item');
Delete From quote_address Where address_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote_address where entity_name = 'sales_flat_quote_address');
Delete From sales_order Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_order where entity_name = 'sales_flat_order');
Delete From sales_order_item Where item_id NOT IN (Select m2_id From ub_migrate_map_step_7_order_item where entity_name = 'sales_flat_order_item');
Delete From sales_order_address Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_order_address where entity_name = 'sales_flat_order_address');
Delete From sales_invoice Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_invoice where entity_name = 'sales_flat_invoice');
Delete From sales_invoice_item Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_invoice_item where entity_name = 'sales_flat_invoice_item');

2. Once done, you continue with the data migration in step #7.

Regards,
Mall.

#5
Profile photo of lakvenkat 700.00 $tone 5 days ago
Public

Hi Mall,
 
We have followed the steps and now we see the below error in step7.
 
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1625’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_order_grid` (`entity_id`, `status`, `store_id`, `store_name`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `shipping_name`, `billing_name`, `created_at`, `updated_at`, `customer_email`, `customer_group`, `customer_name`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18)
 
Please have a look at this issue.

#6
Profile photo of Mall Staff 148890.00 $tone 5 days ago
Public

Hi there,

1062 Duplicate entry ‘1625’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_order_grid` (`entity_id`, `status`, `store_id`, `store_name`,

So, you can try with these steps:

1. Run this SQL query in your M2 database:

Delete From sales_order_grid Where entity_id = 1625;

2. Once done, you can continue to run the data migration in step #7.

Regards,
Mall.

#7
Profile photo of lakvenkat 700.00 $tone 5 days ago
Public

Hi Mall,

As per your suggestion, we removed the records from table and we are having same issues for different id on different table.
 
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1403’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_shipment_grid` (`entity_id`, `increment_id`, `store_id`, `order_increment_id`, `order_id`, `order_created_at`, `total_qty`, `shipping_name`, `created_at`, `customer_name`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9)
Please fix this.
 
Is there any problem to delete the duplicate records from database?

#8
Profile photo of Mall Staff 148890.00 $tone 5 days ago
Public

Hi there,

: 1062 Duplicate entry ‘1403’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_shipment_grid` (`entity_id`, `increment_id`, `store_id`,

Please try with these steps:

1. Run the SQL query in your M2 database:

Delete From sales_shipment_grid Where entity_id = 1403;

2. And then, you continue with data migration in step #7. 

Regards,
Mall.

#9
Profile photo of Mall Staff 148890.00 $tone 5 days ago
Public

Hi there,

Is there any problem to delete the duplicate records from database?

Because you checked ‘KEEP ORIGINAL IDs’ setting in step #7 while you added new sales data in M2 after the first migration, in order to continue with delta migration in step #7 without the duplicated issue you mentioned, you have to delete all related newly added data in the sales data section in M2.
 
Regards,
Mall.

#11

Please login or Register to Submit Answer

Written By

Comments