Short plan:

1. Disable Powersync synchronization

First of all, you need to disable Powersync integration

2. Cleanup the MagentoId filed on the Salesforce side

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 from one Salesforce org - your entity_id field values could be shifted or new record ids could have the same value already used in another Salesforce org.

For example, you had product1 with sku1 and entity_id=1 in the Salesforce org1, but in Salesforce org2 you have product2 with sku2 and entity_id=1. As a result when you start the sync in Magento2 - product1 data will override product2 in your new 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):

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:

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

6) OrderItem, OpportunityLineItem and QuoteLineItem:

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

3. Clean “Magento & Salesforce IDs“ table

4. Connect Magento to a new Salesforce org

Now you are able to connect new Salesforce org to your Magento instance

For more detailed information read the Paid Package article

5. Review and Re-save all module config pages

Open all module config pages one by one and Re-save the configuration. List of configuration pages:

Information about product configuration options you can find in Product Documentation article

6. Define new Pricebooks on the Website pages

Do not forget to change old Pricebooks on the Website page to Pricebooks from the new Salesforce org

To create new Pricebooks read Creating Price Book(s) and configure Salesforce fields article

7. Re-sync all Magento data