6

I want to migrate ORDERS from magento1.

What i already achieved:

  1. Migrate all data(customers,orders,products,categories,settings etc)
  2. Migrate ONLY Customers

Main objective to know config steps which will migrate only orders. OR both Orders and customers.

2 Answers 2

11

For orders, you will usually need customers as well.

I used answer when I first did this.

Only run the bin/magento migrate:data command. And with -r if you want to start from scratch.

In your config.xml, comment out the Eav and other steps you want to exclude:

<steps mode="data">
        <step title="Data Integrity Step">
            <integrity>Migration\Step\DataIntegrity\Integrity</integrity>
        </step>
        <!--<step title="EAV Step">
            <integrity>Migration\Step\Eav\Integrity</integrity>
            <data>Migration\Step\Eav\Data</data>
            <volume>Migration\Step\Eav\Volume</volume>
        </step>-->
        <step title="Customer Attributes Step">
            <integrity>Migration\Step\Customer\Integrity</integrity>
            <data>Migration\Step\Customer\Data</data>
            <volume>Migration\Step\Customer\Volume</volume>
        </step>
        <step title="Map Step">
            <integrity>Migration\Step\Map\Integrity</integrity>
            <data>Migration\Step\Map\Data</data>
            <volume>Migration\Step\Map\Volume</volume>
        </step>
        <!--<step title="Url Rewrite Step">
            <integrity>Migration\Step\UrlRewrite\Version191to2000</integrity>
            <data>Migration\Step\UrlRewrite\Version191to2000</data>
            <volume>Migration\Step\UrlRewrite\Version191to2000</volume>
        </step>-->
        <step title="Log Step">
            <integrity>Migration\Step\Log\Integrity</integrity>
            <data>Migration\Step\Log\Data</data>
            <volume>Migration\Step\Log\Volume</volume>
        </step>
        <step title="Ratings Step">
            <integrity>Migration\Step\Ratings\Integrity</integrity>
            <data>Migration\Step\Ratings\Data</data>
            <volume>Migration\Step\Ratings\Volume</volume>
        </step>
        <!--<step title="ConfigurablePrices step">
            <integrity>Migration\Step\ConfigurablePrices\Integrity</integrity>
            <data>Migration\Step\ConfigurablePrices\Data</data>
            <volume>Migration\Step\ConfigurablePrices\Volume</volume>
        </step>-->
        <step title="OrderGrids Step">
            <integrity>Migration\Step\OrderGrids\Integrity</integrity>
            <data>Migration\Step\OrderGrids\Data</data>
            <volume>Migration\Step\OrderGrids\Volume</volume>
        </step>
        <!--<step title="Tier Price Step">
            <integrity>Migration\Step\TierPrice\Integrity</integrity>
            <data>Migration\Step\TierPrice\Data</data>
            <volume>Migration\Step\TierPrice\Volume</volume>
        </step>-->
        <step title="SalesIncrement Step">
            <integrity>Migration\Step\SalesIncrement\Integrity</integrity>
            <data>Migration\Step\SalesIncrement\Data</data>
            <volume>Migration\Step\SalesIncrement\Volume</volume>
        </step>
        <!--<step title="PostProcessing Step">
            <data>Migration\Step\PostProcessing\Data</data>
        </step>-->
    </steps>

Then in your map.xml ignore most product stuff with:

         <ignore>
             <document>catalog_category*</document>
         </ignore>
         <ignore>
             <document>catalog_compare*</document>
         </ignore>
         <ignore>
             <document>catalog_eav_attribute</document>
         </ignore>
         <ignore>
             <document>cataloginventory_stock*</document>
         </ignore>
         <ignore>
             <document>catalog_product_*</document>
         </ignore>
         <ignore>
             <document>core_*</document>
         </ignore>
         <ignore>
             <document>cms_*</document>
         </ignore>
4
  • in map.xml ignore in source or destination or both?
    – OZZIE
    Commented Aug 11, 2017 at 11:59
  • I added both seems to work!! :)
    – OZZIE
    Commented Aug 11, 2017 at 12:48
  • Seems like you have to delete test customers and test order created on the M2 instance after you've done the initial migration, then this approach works! (You can delete orders with this module: packagist.org/packages/thecodingtutor/magento2-delete-orders )
    – OZZIE
    Commented Aug 11, 2017 at 13:18
  • @Stephen My some of the products get deleted after following this step.
    – Nafsss
    Commented Apr 22, 2021 at 6:05
6

Apologizes for late reply and this was FINAL solution that worked for me.

Config.xml file:

    <steps mode="data">
     <step title="Customer Attributes Step">
         <integrity>Migration\Step\Customer\Integrity</integrity>
         <data>Migration\Step\Customer\Data</data>
         <volume>Migration\Step\Customer\Volume</volume>
     </step>

    <step title="Map Step">
         <integrity>Migration\Step\Map\Integrity</integrity>
         <data>Migration\Step\Map\Data</data>
         <volume>Migration\Step\Map\Volume</volume>
     </step>
     <step title="OrderGrids Step">
         <integrity>Migration\Step\OrderGrids\Integrity</integrity>
         <data>Migration\Step\OrderGrids\Data</data>
         <volume>Migration\Step\OrderGrids\Volume</volume>
     </step>
     <step title="SalesIncrement Step">
         <integrity>Migration\Step\SalesIncrement\Integrity</integrity>
         <data>Migration\Step\SalesIncrement\Data</data>
         <volume>Migration\Step\SalesIncrement\Volume</volume>
     </step>
</steps>

Only command required:

php bin/magento migrate:data vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.1/config.xml

Map.xml: Ignore most tables that were creating issue.

User can get such issues in migration like:

[PDOException] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '77-10' for key 'CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID'

Empty these tables to fix issues. You can figure out tables name like this (Note the initials):

'CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID' = catalog_product_entity_media_gallery_value_to_entity

8
  • 4
    Great work stealing my answer and then choosing it as correct. A great example for building a good community. Fool.
    – tread
    Commented Nov 9, 2017 at 20:44
  • @StevieG ... You misunderstood it. I had fixed the issues before you posted the answer though i posted answer lately. You can see fixed errors as well in my answer. I accepted my answer which BEST work for me AND that really doent mean your answer is not informative. I had already UP-VOTED your answer which means I respect your input.
    – Jarnail S
    Commented Nov 13, 2017 at 7:44
  • @jai can you check this pls? magento.stackexchange.com/questions/207220/… Commented Dec 27, 2017 at 7:48
  • Sure. I will sort out your issue. Please allow me time by evening.
    – Jarnail S
    Commented Dec 27, 2017 at 9:16
  • Also add all ignore lines in your map.xml from @StevieG answer.
    – Jarnail S
    Commented Dec 28, 2017 at 4:30

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