Magento 1 to Magento 2 module migration

Short plan:

  1. Make sure you use Magento1 module version 01.59.37 or higher: older versions don’t push the MagentoId for Salesforce OrderItem and OpportunityLineItem objects as result Magento2 may create OrderItem/OpportunityLineItem duplicates.

    • Upgrade Magento1 module

    • Resync orders you’ll transfer to Magento2

  2. Disable Magento1 sync

  3. Follow the “Prepare Salesforce entities for Magento2 migration“ instruction below.

  4. Configure Magento2 module connection and enable sync process.

Prepare Salesforce entities for Magento2 migration

When we sync Magento entities we match them to Salesforce records by the few fields.

One of these “matching“ fields is “Magento Id“, field code is tnw_mage_basic__Magento_ID__c.

When you switch to the Magento2 - your entity_id field values could be shifted or new record ids could have the same value already used in Magento1.

For example, you had product1 with sku1 and entity_id=1 in the Magento1, but in Magento2 you have product2 with sku2 and entity_id=1. As a result when you start the sync in Magento2 - product2 data will override product1 in your Salesforce because they have matched Magento Id.

To avoid this problem you need to correct the “Magento Id” fields in your Salesforce org. The following Salesforce entities may have this field (related to the package version you use):

  • Campaign

  • Contact

  • Lead

  • Opportunity

  • OpportunityLineItem

  • Order

  • OrderItem

  • Product2

  • Quote

  • QuoteLineItem

If you migrate from Magento1 to Magento2 and keep entity_id unchanged - skip points 1 - 3 and go to the “Prepare Order and Opportunity“ point.

If you migrate data from Magento1 to Magento2 and entity_id changed - you need to clean the Magento Id fields in Salesforce to allow match entities by other fields.

1. Contact and Lead:

These records could be matched by the Email field

Clean the tnw_mage_basic__Magento_ID__c field: push empty value. Use the dataloader for that. Records will be matched by the Email

2. Account:

These records could be matched by the Name field

3. Product2

These records could be matched by the ProductCode field.

Clean the tnw_mage_basic__Magento_ID__c field: push empty value. Use the dataloader for that. Records will be matched by the ProductCode

4. Campaign - Magento2 module doesn’t support this entity sync.

Clean the tnw_mage_basic__Magento_ID__c field: push empty value. Use the dataloader for that. To avoid future collisions.

5. Order, Opportunity and Quote:

These records could be matched by Magento Id field only! It’s not possible to match Magento2 order with Salesforce Order/Opportunity If you did not migrate entity_id and IncrementId fields from Magento1 !

5.1) If you transferred the entity_id field value from Magento1:

Magento1 uses the IncrementId value for the Magento Id, but the Magento2 module uses the entity_id.

For this reason, you need to update this field (tnw_mage_basic__Magento_ID__c) value by the dataloader and push the entity_id data instead defined IncrementId
Example, my Magento Order with IncrementId #100000001 and entity_id: 43789

And Salesforce order looks like here:

And after this step it should looks like here:

5.2) If you did not transfer orders/quotes from Magento1 to Magento2:

Clean the tnw_mage_basic__Magento_ID__c field: push empty value. Use the dataloader for that.

6) OrderItem, OpportunityLineItem and QuoteLineItem:

If you did not transfer Items from Magento1 to Magento2: Clean the tnw_mage_basic__Magento_ID__c field: push empty value. Use the dataloader for that.