1

I've made data migration from Magento 1 to Magento 2 using data-migration-tool according to this article http://devdocs.magento.com/guides/v2.0/migration/migration-migrate-data.html

Orders migrated successfully, but Sales Order grid is empty - this happened because sales_flat_order_grid (from Magento 1) and sales_order_grid (from Magento 2) tables are ignored in the mapping file by default, like this.

<destination>
    <document_rules>
        <ignore>
           <document>sales_order_grid</document>
        </ignore>
    </document_rules>
</destination>

These tables have different columns (Magento2's table has 10 additional columns), and they can't be moved just like that.

Is there any way to re-build sales_order_grid table, based on another tables data?

I've cleaned cache and made all reindexes, with no luck.

1

comment out or remove line 20 to 31 in map.xml file,

<!-- <ignore>
                <document>sales_flat_creditmemo_grid</document>
            </ignore>
            <ignore>
                <document>sales_flat_invoice_grid</document>
            </ignore>
            <ignore>
                <document>sales_flat_order_grid</document>
            </ignore>
            <ignore>
                <document>sales_flat_shipment_grid</document>
            </ignore> -->

Add inside <document_rules> tag of source tag,

 <rename>
            <document>sales_flat_order_grid</document>
            <to>sales_order_grid</to>
        </rename>
        <rename>
            <document>sales_flat_invoice_grid</document>
            <to>sales_invoice_grid</to>
        </rename>
        <rename>
            <document>sales_flat_creditmemo_grid</document>
            <to>sales_creditmemo_grid</to>
        </rename>
        <rename>
            <document>sales_flat_shipment_grid</document>
            <to>sales_shipment_grid</to>
        </rename>

Add below content under <field_rules> tag of source tag.

     <move>
            <field>sales_flat_creditmemo_grid.grand_total</field>
            <to>sales_creditmemo_grid.order_base_grand_total</to>
        </move>
         <!-- source table custom  grid field-->
        <ignore>
            <field>sales_flat_invoice_grid.base_grand_total</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.store_to_order_rate</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.base_to_order_rate</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.store_to_base_rate</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.base_to_global_rate</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.creditmemo_status</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.invoice_id</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.store_currency_code</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.order_currency_code</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.base_currency_code</field>
        </ignore>
        <ignore>
            <field>sales_flat_creditmemo_grid.global_currency_code</field>
        </ignore>

comment out or remove line inside <destination> <document_rules> tag,

 <!-- <ignore>
            <document>sales_creditmemo_grid</document>
        </ignore>
        <ignore>
            <document>sales_invoice_grid</document>
        </ignore>
        <ignore>
            <document>sales_order_grid</document>
        </ignore> 
        <ignore>
            <document>sales_shipment_grid</document>
        </ignore>-->

Add below line inside <destination> part of <field_rules> tag

        <ignore>
            <field>sales_order_grid.billing_address</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.shipping_address</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.shipping_information</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.customer_email</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.customer_group</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.subtotal</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.shipping_and_handling</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.customer_name</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.payment_method</field>
        </ignore>
        <ignore>
            <field>sales_order_grid.total_refunded</field>
        </ignore>

    <ignore>
        <field>sales_invoice_grid.store_name</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.customer_name</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.customer_email</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.customer_group_id</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.payment_method</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.billing_address</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.shipping_address</field>
    </ignore>
     <ignore>
        <field>sales_invoice_grid.shipping_information</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.subtotal</field>
    </ignore>
    <ignore>
        <field>sales_invoice_grid.shipping_and_handling</field>
    </ignore>

    <ignore>
        <field>sales_shipment_grid.customer_name</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.order_status</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.billing_address</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.shipping_address</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.billing_name</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.shipping_name</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.customer_email</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.customer_group_id</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.payment_method</field>
    </ignore>
    <ignore>
        <field>sales_shipment_grid.shipping_information</field>
    </ignore>

    <ignore>
        <field>sales_creditmemo_grid.billing_address</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.shipping_address</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.customer_group_id</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.order_status</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.customer_name</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.customer_email</field>
    </ignore>
     <ignore>
        <field>sales_creditmemo_grid.payment_method</field>
    </ignore>
     <ignore>
        <field>sales_creditmemo_grid.shipping_information</field>
    </ignore>
     <ignore>
        <field>sales_creditmemo_grid.subtotal</field>
    </ignore>
     <ignore>
        <field>sales_creditmemo_grid.shipping_and_handling</field>
    </ignore>
     <ignore>
        <field>sales_creditmemo_grid.adjustment_positive</field>
    </ignore>
    <ignore>
        <field>sales_creditmemo_grid.adjustment_negative</field>
    </ignore>

save map.xml file and run php magento migrate:data /var/www/html/{{magentoroot}}/vendor/magento/data-migration-tool/etc/ce-to-ce/{{CE version}}/config.xml

  • I follow same things, still it not import grid data for Order, Invoice, Shipment and credit memo. And other idea for this? – Dhiren Vasoya May 24 '18 at 10:47
  • Hi @rakesh please let me know why you have ignored these fields? is there any specific reason. – Nagaraju K Aug 20 at 2:27
  • @rakesh I have followed your step but no luck – Nagaraju K Aug 20 at 10:36
  • @rakesh can u please help on this ASAP magento.stackexchange.com/questions/291019/… – Nagaraju K Sep 27 at 19:16
  • Hello, I have one question about this. I run the migration and all things working. just orders are not working. can I run the migration again with changes as you suggested? – Utsav Gupta Nov 5 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.