Top Banner

Click here to load reader

DataMigration_AX2012

Aug 22, 2014

ReportDownload

Documents

koggen

Microsoft Dynamics AX 2012

Data Migration for Microsoft Dynamics AX 2012White Paper Microsoft Dynamics AX 2012 includes many different ways to import data into the system. Because the Microsoft Dynamics AX 2012 data model was normalized, choosing an import method can be challenging. This document provides guidance about which import method to choose for specific situations.

Date: February 2012 www.microsoft.com/dynamics/ax Patrick Nelson, Solution Architect Send suggestions and comments about this document to [email protected] Please include the title with your feedback.

1 DATA MIGRATION FOR MICROSOFT DYNAMICS AX 2012

Table of ContentsIntroduction ................................................................................................ 3 Data complexity in Microsoft Dynamics AX 2012......................................... 3 Options for importing data into Microsoft Dynamics AX 2012 ..................... 4Microsoft Dynamics AX import ................................................................................................ 4 Microsoft Excel Add-in for Microsoft Dynamics AX ..................................................................... 5 Using document services with the Excel Add-in to import data................................................. 5 Using the Excel Add-in to import tables ................................................................................ 5 RapidStart Services ............................................................................................................... 7 AIF, document services, and custom code ................................................................................ 9 Examples of using AIF to import global address bookrelated data .............................................10 Customer import .............................................................................................................. 10 Vendor import .................................................................................................................. 15 HCMWorker (employee or worker) import ............................................................................ 16 Product-item data management services ............................................................................. 19

Recommended import methods for specific tables and entities................. 26 Performance considerations...................................................................... 28

2 DATA MIGRATION FOR MICROSOFT DYNAMICS AX 2012

IntroductionMicrosoft Dynamics AX 2012 must be populated with configuration and master data records before an organization can start using it. To minimize data duplication and enable change tracking in Microsoft Dynamics AX, the underlying database schema is quite complex. This complexity can present challenges to system integrators and developers who are migrating data from other systems into Microsoft Dynamics AX. Data is likely to be imported many times during the life cycle of a system; for example, when you migrate from another system, set up a new test or demonstration environment, or add new master data. This document is only intended to describe how to perform the initial data load into a new system. The following table describes the types of data that can be imported or set up in the system. Type of dataSystem configuration data

DescriptionData used to set up the Microsoft Dynamics AX environment. This data is not considered part of data migration, but part of your initial setup and configuration. Microsoft Dynamics ERP RapidStart Services can be used to set the system configuration data. Data specific to each module in the environment. This data is typically migrated from a test or staging environment into a production environment. It is not imported from another ERP system. Entities that describe the parties, locations, products, and activities that are referenced by entities that document and record business events. Examples of this type of data are customers, vendors, products, ZIP Codes/postal codes, payment methods, and delivery methods. Entities that document business events and record their economic value. Examples of this type of data are ledger transactions, customer transactions, and inventory transactions.

Parameter data

Master data

Transactional data

Data complexity in Microsoft Dynamics AX 2012The complexity of the data model in Microsoft Dynamics AX 2012 has increased significantly from previous versions, both because the data model was normalized, and because of other functionality added in Microsoft Dynamics AX 2012. When you import entities, such as customers, vendors, or sales orders into the system, those entities can map to multiple tables in the database. The options that you can use to import a specific type of entity vary, based on the complexity of the data model that underlies that functionality. Complexity can also be caused by the need to conform to the principles that underlie the Microsoft Dynamics AX data model. The following table describes core concepts that impact data model complexity. Core conceptTable inheritance

ImpactTable inheritance is a concept that recognizes and represents generalized and specialized relationships between data entities. In Microsoft Dynamics AX 2012, tables can inherit, or extend, from the tables that are situated above them in a hierarchy. A base table contains fields that are common to all tables that are derived from it. A derived table inherits these fields but also contains fields that are unique to its purpose. Each table contains the SupportInheritance and Extends properties, which can be used to control table inheritance. When you import a table that inherits from a base table, you must also import the base table. This is most easily accomplished through code.

3 DATA MIGRATION FOR MICROSOFT DYNAMICS AX 2012

Core conceptDate effectivity

ImpactValid time state tables can be used to store and track an objects history over its lifetime in Microsoft Dynamics AX 2012. Valid time state tables are often used to track changes to an entity, which requires that some of the data about an entity be stored in a separate table. It is important that you not access valid time state tables directly, but instead use a service abstraction. A view can be thought of as either a virtual table or a stored query. The data accessible through a view is not stored in the database as a distinct object. What is stored in the database is a SELECT statement. The result set of the SELECT statement forms the virtual table returned by the view. Views are used extensively in Microsoft Dynamics AX to access highly normalized data. Views are employed by services that reference these constructs to help simplify the programming model and data access patterns.

Views and normalization

One-to-many relationships

Many Microsoft Dynamics AX entities allow for one-to-many relationships. For example, the global address book allows an unlimited number of addresses and an unlimited amount of contact information to be associated with each party. One-to-many relationships can make it challenging to present information in a tabular format such as a worksheet, where all contact information for a particular party (customer or vendor) is frequently typed on a single line. A financial dimension is a data classifier created from the parties, locations, products, and activities in an organization. The master entities, such as customers, vendors, and workers, contain default financial dimensions that help populate default transaction information. The underlying storage for dimensions and the associated rules and combinations is complex, and the logic to properly associate dimension attributes with a master entity must be done by calling the correct APIs rather than populating data directly into tables.

Financial dimensions

Surrogate keys and record IDs

Most tables in Microsoft Dynamics AX have a surrogate key, usually the record ID (RecId) of the table, which is used as the primary key. Tables related to the original (parent) table usually have the surrogate key of the parent as a foreign key. RecIdThis provides the benefit of being able to rename items and show friendly names in the user interface while maintaining the data integrity of the stored information. Because RecIds are allocated by the system as data is inserted, maintaining primary key/foreign key relationships without using a service abstraction or APIs is quite difficult and prone to error.

It is often helpful, before you import data into Microsoft Dynamics AX, to review E/R diagrams of the data structures that you will be working with. We recommend that you use either the Application Analysis Tool that is available on InformationSource or the Reverse Engineering tool.

Options for importing data into Microsoft Dynamics AX 2012This section describes the functionality that is available in Microsoft Dynamics AX 2012 for importing data.

Microsoft Dynamics AX importMicrosoft Dynamics AX import (available from System administration > Common > Data export/import > Import) is the primary mechanism for transferring data between different Microsoft Dynamics AX instances. You cannot use this import method to migrate data from another ERP system or an older version of Microsoft Dynamics AX. To use this functionality and correctly create definition groups, you should have a clear understanding of the underlying data model. No business logic can be invoked to validate or otherwise modify data when you use this functionality. It simply writes the data into the tables exactly as it is in the import file.4 DATA MIGRATION FOR MICROSOFT DYNAMICS AX 2012

For more information, see the following resources: Import initial setup data Create definition groups for import and