How to migrate only orders with Data Migration Tool?
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>
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