--- title: "Migrate product masters and product variants" slug: "migrate-product-masters-and-product-variants" description: "Migrate product masters and variants from AX2012 to D365 F&SCM with our guide on using the Database connector for efficient data migration." tags: ["Concept topic"] status: "update" updated: 2026-10-05T12:14:29Z published: 2026-10-05T12:14:29Z canonical: "docs.staedean.com/migrate-product-masters-and-product-variants" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Migrate product masters and product variants To migrate product masters and product variants from AX2012 to D365 F&SCM can be a challenge. This topic explains how you can set up the migration of product masters and product variants. ## Products table structure Usually, a table in AX2012 or D365 F&SCM matches one on one with a table in the database. However, in several cases, a table inheritance structure is used. This is the case for product masters and product variants. For a data migration from AX2012 to D365 F&SCM, you use a **Database** connector. The **Database** connector connects directly to the SQL database of the AX2012 environment and not to AX2012 itself. In the SQL database, only the **EcoResProduct** base table is shown. The other tables, like **EcoResProductMaster** and **EcoResDistinctProductVariant**, are inherited from the base table. Therefore, in the source documents for a data migration of product masters and product variants, you can only select the **EcoResProduct** table. ![Hierarchy browser displaying SQL tables and fields in AX2012/D365FO environment.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/AX2012-ProductMasterTableStructure2.png) ## Migrate product masters, creating external references A product variant refers to a product master. To migrate product variants efficiently, first migrate product masters. Make sure to generate the external references during the migration. ### Source document for product masters To migrate product masters: 1. Create a source document of type ODBC and link it to the application as defined for your AX2012 environment. 2. Add a record to the document for the **EcoResProduct** table as available in the SQL database of the AX2012 environment. > [!NOTE] > Note > > To connect to the SQL database, the **Database connector** is used that is defined as default **Database connector** for your data migration project. 3. To generate external references, for the **EcoResProduct** record, on the **Line details**, in the **External reference** field, select the **RecIdSrc** field. This field contains the unique ID of the record in AX2012. ![Overview of EcoResProductMaster document with highlighted application and record details.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdMaster-SourceDocument.png) #### Source document range The source document record refers to the **EcoResProduct** table. However, you only want to migrate the product masters. Therefore, for the **EcoResProduct** record, define a range to limit the migration to the product masters only. To do so, use the ID of the **EcoResProductMaster** table in the AOT of AX2012. ![Table displaying EcoResProductMaster properties including ID, Name, and Label details.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/AX2012-ProductMasterTableNumber.png) Create the range for the **InstanceRelationType** field. ![Record details showing fields and values in a database interface.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdMaster-SourceDocument-Range.png) ### Target document for product masters To migrate product masters: 1. Create a target document of type D365 F&SCM and link it to the application as defined for your D365 F&SCM environment. 2. Add a record to the document for the **EcoResProductMaster** table in D365 F&SCM. ![Document overview for EcoResProductMaster with application and record details displayed.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdMaster-TargetDocument.png) ### Message for product masters To migrate product masters: 1. Create a message using the source and target documents as created for the product master migration. 2. Add a record mapping for the **EcoResProductMaster** record and map it to the **EcoResProduct** record of the source document. 3. To generate external references, for the **EcoResProductMaster** record mapping, set the **External reference** field to **Yes**. As a result, when the message is run, after a product master is inserted in D365 F&SCM, the related external reference is created. External references are stored in the source connector application. 4. In the field mapping, mark the **DisplayProductNumber** as key field. ![Mapping fields between source and target documents in EcoResProductMaster interface.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdMaster-Message.png) ## Migrate product variants, applying external references as created for the master products When the product masters are migrated, you can migrate the product variants. Apply the external references as generated for the product masters. ### Source document for product variant To migrate product variants: 1. Create a source document of type **ODBC** and link it to the application as defined for your AX2012 environment. 2. Add a record to the document for the **EcoResProduct** table as available in the SQL database of the AX2012 environment. > [!NOTE] > Note > > To connect to the SQL database, the **Database connector** is used that is defined as default **Database connector** for your data migration project. ![Document interface showing application and record details for EcoResDistinctProductVariant.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdVariant-SourceDocument.png) #### Source document range The source document record refers to the **EcoResProduct** table. However, you only want to migrate the product variants. Therefore, for the **EcoResProduct** record, define a range to limit the migration to the product variants only. To do so, use the ID of the **EcoResDistinctProductVariant** table in the AOT of AX2012. ![Table displaying product variant details including ID, name, and label information.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/AX2012-ProductVariantTableNumber.png) Create the range for the **InstanceRelationType** field. ![Record details showing fields and range type for INSTANCERELATIONTYPE in BisBufferTable.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdVariant-SourceDocument-Range.png) ### Target document for product variant To migrate product variants: 1. Create a target document of type D365 F&SCM and link it to the application as defined for your D365 F&SCM environment. 2. Add a record to the document for the **EcoResDistinctProductVariant** table in D365 F&SCM. ![Document overview showing application and record details for EcoResDistinctProductVariant.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdVariant-TargetDocument.png) ### Message for product variant To migrate product variants: 1. Create a message using the source and target documents as created for the product variant migration. 2. Add a record mapping for the **EcoResDistinctProductVariant** record and map it to the **EcoResProduct** record of the source document. 3. To apply external references of the related product masters, for the **EcoResDistinctProductVariant** record mapping, for the **ProductMaster** field mapping, select the **External reference** check box. ![Mapping details for EcoResDistinctProductVariant with source and target document fields.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdVariant-Message.png) #### External reference field option For the selected **External reference** field option, fill in the fields. This setup gets the external reference of the related product master. As a result, the created product variant is linked to applicable product master in D365 F&SCM. ![Mapping interface showing target and source records with external reference options highlighted.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MigrateProdVariant-Message-FieldOption.png) ## Related - [Improve data migration performance](/improve-data-migration-performance.md) - [Design data migration](/design-data-migration.md) - [Run data migration project](/run-data-migration-project.md)