Friday, 5 April 2013

Data Import/Export Framework–Move data from AX to another AX environment

This below is a step by step to export data from an AX environment to another environment using the Data Import/Export Framework.

Export from Source AX environment

1. Open the Source data formats form.

Create a record and select AX type.

DataFormat2013-03-31_1743

2. Open the Processing group form and create a new record.

Proc2013-03-31_1837

3. Click on Entities button.

Select your entities you want to export (Example below has Customers).

Entit2013-03-31_1838

4. (Optional) You can click on the Select button to put a filter.

Q2013-03-31_1840

5. Go back the Processing group form and click the Get staging data button. This will bring up the following execution form. Click the Run. This will then pull data and place it in staging table. It will enable the buttons on the Processing group form.

Stag2013-03-31_1846

6. On the Processing group form, click the Export to AX button. This will bring up a dialog, enter the file name and type.

E2013-03-31_1851

This will generate a dat and def file.

Import into Destination AX environment (Option 1)

We will import the file using dat/def. Other options to use files.

1. Click on System administration > Common > Data export/import > import

Select your file.

I2013-03-31_1855

There is an option on the Advanced tab. Tick the Update existing record flag if you dont want to replace some important data in your Data Import/Export Framework tables.

I2013-03-31_1855_001

Click OK.

2. This will import data into the staging table and the processing group table. Ready to be executed.

3. Go the Processing group form and you should find the data already in the staging table too.

4. Click on the Copy data to target button. Follow the prompts and run it. This step will move the data from the staging table to the target destination.

Import into Destination AX environment (Option 2)

After we have our data in the staging tables. Instead of exporting to dat/def files. We will instead export to a flat file (csv).

1. In the Execution history. Click on the view staging data. This will bring up a dynamic grid showing your data.

E2013-03-31_1911

2. Click on the Export to file button. This will allow you to select a processing group (a file format setup).

Enter your file name and click OK.

s2013-03-31_1914

This has generated a file now that you can use for importing into your other environment.

Follow these step by step that I wrote last year to import using a file (csv).

http://dynamicsnavax.blogspot.com.au/2012/08/step-by-step-import-with-data-migration.html

6 comments:

Anonymous said...

Is there any difference exporting from DMF than using standard definition groups? It appears not..?

Munib Ahmed said...

There is a big difference.
definition groups import straight to the table.
1. You have to figure out all the ables
2. With 2012 tables using surrogate keys. You will run into tables with invalid recId references.

What the data i/e framework does is go from staging table to the appropriate tables resolving all recIds.

Lets take an example of trying to move customers from 1 environment to another. Its almost impossible with definition groups. Global address books is hard enough to deal with. Also, all the reference tables using surrogate keys (recId foreign keys).

So, I think this addition is a very welcomed one.

Kurt said...

I am trying to follow your steps for Option 2 so that I can look at the data exported out. In the "Export data to flat file" dialog, the Processing group has a red squiggly line but everything I type produces a Processing is not valid error. Where do I enter that prior to this process.

Anonymous said...

I am interested in just copying processing groups with configuration from one env(dev) to another(test)? no data.. will this approach work and copy the processing group along with configurations?

Munib Ahmed said...

When you import the dat/def contains the tables it will import. So, you can exclude it if you don't want tables.
Otherwise, just import it as whole and don't process the data.

Daniel said...

I am having difficulties exporting to a flat file format (options 2). When trying to specify a processing group in the "Export data to flat file" form i can't find any. It is possible when I use a File format processing group, but not when I use an AX file format. What am I missing here? Great guide BTW.