Migrating orders doesn't migrate total values Has anyone tried migrating commerce orders? I had problems tracing the tables that was used by commerce order.

Initially, I've already mapped commerce_order_total and commerce_order_total:currency_code (in the ui: http://prntscr.com/9a6bid). My query from the source database also outputs correctly. My problem is after migrating, commerce total values were not migrated (http://prntscr.com/9a6cko).

Am I in the right track? Please help.

I'm also confused why commerce_line_item is needed in commerce order and order_id is needed in commerce line item. I'm really confused.

Are there any existing useful links regarding this?

Thanks for any help!
The bi-directional link is a relic of the Drupal 7 entity API at the time we wrote Drupal Commerce 1.x. It was basically a DX concession of dubious benefit, but we'll be fixing that in 2.x. ; )

As for how order totals are calculated, order save automatically calculates the total by summing up all of the price components in the "total" price fields on line items. If you haven't properly set the associations in your line items or if you haven't set the price component arrays for the line items you've created, your order total will not calculate properly.