Yes, you can use the data-migration-tool
for this, and I'd recommend to do so over any other methods: it will do the necessary field value conversions where needed.
We were in a similar position as you: we imported product data (catalog, products) at an earlier point in time, then built the shop's design and functionalities and now will do a final data migration run for the customers, quotes, orders, logs and similar stuff.
In the config.xml
, comment out the substeps you do not want to run again. in my case, I have the following disabled:
- settings: everything
data: eav step, url rewrite step, configurable prices step, tier price step, post processing step
in map.xml
, I made sure to ignore all tables that I do not want the data to be migrated for.
Be sure to include the necessary
<ignore><document>{tablename}</document></ignore>
in both sections (<source>
and <destination>
(maybe called <target>
in older versions)).
Be sure to test the migration on a copy of your db's (both magento 1.x and magento 2.x) as it can be quite destructive. It took me a few days and tries to get the mappings adjusted to our needs, but now the migration runs through without a hick.
I was not able to get the delta migration properly running with the above modifications, but in most cases, you'll only want to migrate the data just once before switching the new shop live.
If your 1.x shop has a fair amount of data, the migration process will take quite a while tho. be sure to run the migration in a screen
shell session or similar to avoid data loss due to disconnects.
Yes, it is possible but you will have to modify a bit the config files to get what you need.
Here is an example of the Data Migration Tool config.xml
used to migrate only customers and newsletters subscribers.
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../../config.xsd">
<steps mode="data">
<step title="Data Integrity Step">
<integrity>Migration\Step\DataIntegrity\Integrity</integrity>
</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="Newsletter Subscribers Step">
<integrity>Migration\Step\Newsletter\Integrity</integrity>
<data>Migration\Step\Newsletter\Data</data>
<volume>Migration\Step\Newsletter\Volume</volume>
</step>
</steps>
<steps mode="delta">
<step title="Customer Attributes Step">
<delta>Migration\Step\Customer\Delta</delta>
<volume>Migration\Step\Customer\Volume</volume>
</step>
</steps>
<source>
<database host="172.x.x.x" name="source-db-name" user="dbuser" password="dbpassword"/>
</source>
<destination>
<database host="172.x.x.x" name="source-db-name" user="dbuser" password="dbpassword"/>
</destination>
<options>
<map_file>etc/ce-to-ee/1.7.0.0/map.xml</map_file>
<customer_map_file>etc/ce-to-ee/map-customer.xml</customer_map_file>
<customer_document_groups_file>etc/ce-to-ee/customer-document-groups.xml.dist</customer_document_groups_file>
<customer_attribute_groups_file>etc/ce-to-ee/customer-attribute-groups.xml.dist</customer_attribute_groups_file>
<delta_document_groups_file>etc/ce-to-ee/deltalog.xml</delta_document_groups_file>
<map_document_groups>etc/ce-to-ee/map-document-groups.xml.dist</map_document_groups>
<bulk_size>0</bulk_size>
<direct_document_copy>0</direct_document_copy>
<source_prefix />
<dest_prefix />
<auto_resolve_urlrewrite_duplicates>0</auto_resolve_urlrewrite_duplicates>
<log_file>migration.log</log_file>
<progress_bar_format>%percent%% [%bar%] Remaining Time: %remaining%</progress_bar_format>
<upgrade_customer_password_hash>1</upgrade_customer_password_hash>
<edition_migrate>ce-to-ee</edition_migrate>
<edition_number>1.7.0.0</edition_number>
<init_statements_source>SET NAMES utf8;</init_statements_source>
<init_statements_destination>SET NAMES utf8;</init_statements_destination>
<crypt_key>xxxxxxxxpatataxxxxxxxxxx</crypt_key>
</options>
In this example you can see how all unnecessary steps have been removed to leave only Customer Attributes Step
which is in charge of customer migration.
Newsletter Subscribers Step
is a custom step created to migrate specific data.
You can use this example to modify your config.xml
file and migrate only customers and sales data.
Hope it helps.
Best Answer
so I was able to migrate the customers and orders into the magento 2 again, without needing to use the delta migration step, nor empty the existing magento 2 orders/customers. I think it just overwrites the existing entries.
this is my config.xml data step looks like
this is the map.xml looks like