migration billing_address_id

Hi Mall,
I installed another extension which converts guests to customers, which uses the fields/attributes “billing_address_id” and “shipping_address_id” from the table “sales_order”
But from the M1 migrated orders/rows, those 2 attributes are empty (NULL). Only in M2 created orders have data.
In M1 i see data in those attributes in “sales_flat_order”.
Should they be migrated with your migration tool?

Thanks!
Wim

 

15 answers

Profile photo of Mall Staff 178190.00 $tone March 31, 2022
Public

Hi there,

In M1 i see data in those attributes in “sales_flat_order”.
Should they be migrated with your migration tool?

As you saw, that is custom fields in sales order in your M1. And it is beyond of default support scopes of our migration tool.
To migrate that data fields you can consider submitting Custom Work Service from us and our developers will help you out.
Regards,
Mall.

#1
Profile photo of Wim Fleuren 190.00 $tone March 31, 2022
Public

Hi,
On https://docs.magento.com/mbi/data-analyst/data-warehouse-mgr/sales-flat-order-table.html
i see that “billing_address_id” and “shipping_address_id” are standard Magento fields.
Why do you call them custom fields?

Best regards,
Wim

#2
Profile photo of Mall Staff 178190.00 $tone March 31, 2022
Public

Hi there,

i see that “billing_address_id” and “shipping_address_id” are standard Magento fields.
Why do you call them custom fields?

Yes, I’m sorry about that. So that fields will be migrated as the default function of our migration tool. And the issue you mentioned is strangling:

But from the M1 migrated orders/rows, those 2 attributes are empty (NULL).

If you are using the latest version 3.2.6 of our module, you can try running delta migration in steps #6 and step #7 of our module by running CLI commands:

php -f bin/magento run --step=6 --mode=update;

and then run the CLI command in step #7:

php -f bin/magento run --step=7 --mode=update;

And then, you check the issue you mentioned again. And tell me how it goes.
Regards,
Mall.

#3
Profile photo of Wim Fleuren 190.00 $tone April 1, 2022
Public

Hi Mall,
Going in the right direction.
Updating step 6 no problems.
Step 7: had some issues, but after delete some rows in “ub_migrate_map_step_7_***” (according to ../magento-2-data-migration-faqs-part-3/ -> If you delete Sales data in Step 7″)
it was running for a long time but ending with this:

[Processing][delta] Step #7 migration completed with 100 record(s) in the ‘sales_flat_order’ table.
……………………………………………………………………………………………………………………………………………………..
[Processing][delta] Step #7 migration completed with 54 record(s) in the ‘sales_flat_order’ table.

PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php at line 1879
#0 /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php(372): Step7Controller->_migrateActiveQuote()
#1 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(80): Step7Controller->actionRun()
#2 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(36): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /data/web/magento2/pub/ub-tool/yii-1.1.22/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /data/web/magento2/pub/ub-tool/yii-1.1.22/yiic.php(33): CConsoleApplication->run()
#9 /data/web/magento2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /data/web/magento2/bin/ubdatamigration(4): require_once()
Do i have to remove some other rows as well?

Good news: i see that many “billing_address_id” and “shipping_address_id” contain data now 🙂   

Best regards,
Wim

#4
Profile photo of Mall Staff 178190.00 $tone April 4, 2022
Public

Hi there,

PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php at line 1879

To solve that issue, you can run the following CLI command:

php -f bin/ubdatamigration clean --step=7;

Once done, you continue with delta migration in step #7 by running the CLI command:

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

Regards,
Mall.
 

#5
Profile photo of Wim Fleuren 190.00 $tone April 5, 2022
Public

Hi Mall,
Step #7 migration completed successfully
Total Data Migrated: 100%

When i look in the sales_order table, to check the “billing_address_id” and “shipping_address_id”, i notice that this fields are empty after in M2 created test orders from 2021-04-23 till 2021-11-04. So migrated rows after that date don’t have values for those _id’s anymore.

Sp, the migrated data before that tests order do contain that address_id data, the test data also.
In the sales_shipment and sales_info tables they are present in all rows.
what could be wrong?

Regards,
Wim

#6
Profile photo of Mall Staff 178190.00 $tone April 5, 2022
Public

Hi there,

 When i look in the sales_order table, to check the “billing_address_id” and “shipping_address_id”, i notice that this fields are empty after in M2 created test orders from 2021-04-23 till 2021-11-04. So migrated rows after that date don’t have values for those _id’s anymore.

Please provide me with information about your instance:
+ Admin credentials and URL to the backend
+ SSH credentials and lets me know the path to the M2 folder
+ phpMyadmin URL which can view your M1 and M2 databases
+ Some sales order IDs which has the issue you mentioned
I will help to check further on that sales orders and get back to you then.

Regards,
Mall.

#7
Profile photo of Mall Staff 178190.00 $tone April 6, 2022
Public

Hi there,

When i look in the sales_order table, to check the “billing_address_id” and “shipping_address_id”, i notice that this fields are empty after in M2 created test orders from 2021-04-23 till 2021-11-04. So migrated rows after that date don’t have values for those _id’s anymore.

Please provide me with more information about your instance:
+ Admin credentials and URL to the backend
+ SSH credentials and the path to the M2 folder
+ phpMyadmin URL which can view your M1 and M2 databases
+ Some sales order IDs which have the issue you mentioned

I will help to check further on that sales orders and get back to you then.

Regards,
Mall.

#9
Profile photo of Mall Staff 178190.00 $tone April 7, 2022
Public

Hi there,

I got this issue when accessing the backend of your site: http://prntscr.com/TIhUeBYlEEuH
It seems that you have not deployed static files at your site successfully yet.
And I couldn’t open an SSH connection to your server yet: http://prntscr.com/9V3R5KAs8oCi
Please check your server settings again, In case you need to whitelist my IP: 113.23.42.206

With both older and newer migrated orders, it seems both empty:
older: ORD-2027710
newer: ORD-2027864

I checked on the sales order that has increment ID = ‘ORD-2027710’ in your M2 database and saw that:
1. That sales order has values on the ‘billing_address_id, shipping_address_id’: http://prntscr.com/Vh-fkUrVSMJK
and the related addresses are located in the table ‘sales_order_address’: http://prntscr.com/_vyWwArJ8nmP
2. The issue you mentioned happened on the sales order has increment ID ‘ORD-2027864’: http://prntscr.com/f1xJo4B8e8Ki
That sales order was migrated by our migration tool from the same increment ID in your M1 database: http://prntscr.com/P-VU1Xq7L0l-
In the M1 database that sales order has two address IDs: 20155, 20156 and these addresses are located in table ‘sales_flat_order_address’ in your M1 database too: http://prntscr.com/16O2Rq97Urjr
These addresses were migrated to your M2 database by our migration tool: http://prntscr.com/g-uXunva7LEl , their address IDs are: 50854, 50855: http://prntscr.com/DrdYqUyrogsf and these addresses are located in your M2 database too: http://prntscr.com/qqds0ayh1hU5
For all information above the missing address IDs on the sales order (ORD-2027864) is strange. 

So, please try running delta migration in step #7 with ‘update’ mode by running the following CLI command again:

php -f bin/magento run --step=7 --mode=update;

Make sure you finish step #7 without any issue. Then please check the issue mentioned above about the sales order again (ORD-2027864).
 

Regards,
Mall.
 

#11
Profile photo of Wim Fleuren 190.00 $tone April 7, 2022
Public

Hi Mall,
Strange, the SSH credentials are ok.
Yesterday evening i was busy with that require.js stuff and had to clear cache and static content just for some minutes a few times. 
Should work!
As far as i know for this the IP’s are not blocked for login, but i added you to for the basic auth.

I ran the #7 update:

No problems, 1-way-run:
Step #7 migration completed successfully
Total Data Migrated: 100%

In the sales order table only the most recent 18 rows do miss values for the shipping_address_id and billing_shipment_id
See the last 20 rows: https://prnt.sc/HUWkNGhsPE2O
So, its working almost!

This fields are 100% migrated in sales_creditmemo, sales_invoice and sales_shipment.

(But still not showed in the admin order grid.  Maybe is other issue. The order grid has a 3rd party extension.)

Regards,
Wim

#12
Profile photo of Mall Staff 178190.00 $tone April 8, 2022
Public

Hi there,

I ran the #7 update:
No problems, 1-way-run:
Step #7 migration completed successfully
Total Data Migrated: 100%

Yes, and after that the issue on the sales order increment ID = ORD-2027864 was solved: http://prntscr.com/Nh0MZMgvfIw5 .
As you can see, the values of ‘shipping_address_id, billing_address_id’ on that sales order were migrated correctly now. 

But still not showed in the admin order grid.  Maybe is other issue. The order grid has a 3rd party extension.

Yes, that is because the billing address and shipping address of that sales order (entity_id = 24773) are still missing in the table ‘sales_order_grid’: http://prntscr.com/OVRjjxqshPMb .
Please note that ‘shipping_address, billing_address’ are new fields in the table ‘sales_order_grid’ in M2 only. And these fields are not located in the related data table ‘sales_flat_order_grid’ in the M1 database.
And the 3rd module you mentioned should look for shipping address and billing address information on the related tables ‘sales_order’ and ‘sales_order_address’ in the M2 database.

Please let me know if you want to migrate update for that information for both migrated data records in the table ‘sales_order_grid’ in M2 database, I will provide a workaround for it later.
 

Regards,
Mall.
 
 

#13
Profile photo of Wim Fleuren 190.00 $tone April 8, 2022
Public

In the sales order table only the most recent 18 rows do miss values for the shipping_address_id and billing_shipment_id
See the last 20 rows: https://prnt.sc/HUWkNGhsPE2O

What about this issue?

Sales_order_grid: Let me know what is possible.

Thanks,
Wim 

#14
Profile photo of Mall Staff 178190.00 $tone April 8, 2022
Public

Hi there,

See the last 20 rows: https://prnt.sc/HUWkNGhsPE2O
What about this issue?

I checked further on your M1 and M2 databases and I saw that issue. That issue happened on some new sales orders added in M1 after the first migration only. And the root of that issue is that the related sales order addresses were not migrated in the migrating time of that sales orders. And this issue happened when you have not checked ‘KEEP ORIGINAL IDs’ in settings in step #7 only. 
To delta update for that sales orders, you can simply run delta migration in step #7 with ‘update’ mode by running the CLI command below with dates filter (this helps to save the time of delta migration):

php -f bin/ubdatamigration run --step=7 --mode=update --startDate="2022-03-01" --endDate="2022-04-15";

And to exclude that issue in the next delta migration you can apply more tweak code in step #7 of our migration tool by steps as the following:
1. Open the PHP file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find the code lines:

if (is_null($m2Id)) {
UBMigrate::log([
'entity_name' => $model->tableName(),
'm1_id' => $model->entity_id,
'm2_id' => $model2->entity_id,
'm2_model_class' => get_class($model2),
'm2_key_field' => 'entity_id',
'can_reset' => UBMigrate::RESET_YES,
'step_index' => "7OrderAddress"
]);
}

and replace by code lines:

if (is_null($m2Id)) {
UBMigrate::log([
'entity_name' => $model->tableName(),
'm1_id' => $model->entity_id,
'm2_id' => $model2->entity_id,
'm2_model_class' => get_class($model2),
'm2_key_field' => 'entity_id',
'can_reset' => UBMigrate::RESET_YES,
'step_index' => "7OrderAddress"
]);
}
//re-update shipping address and billing address if has changed
if (!$keepOriginalId) {
$salesOrder = Mage1SalesOrder::model()->find("entity_id = {$parentId}");
$salesOrder2 = Mage2SalesOrder::model()->find("entity_id = {$parentId2}");
$salesOrder2->shipping_address_id = UBMigrate::getM2EntityId('7_order_address', 'sales_flat_order_address', $salesOrder->shipping_address_id);
$salesOrder2->billing_address_id = UBMigrate::getM2EntityId('7_order_address', 'sales_flat_order_address', $salesOrder->billing_address_id);
$salesOrder2->update();
}

Regards,
Mall.
 

#15

Please login or Register to Submit Answer

Written By

Comments