20 May 2014

TDTT - Test Data Transfer Tool - Part 2

To just exprot some tables from AX 2012 navigate to the [lists] folder of the test data transfer tool and open one of the exclude files. Add the following regular expression

.*(?<!^InventTable)

This will exclude all tables except the one defined wthin the brackets. If you want to add more tables just add them in the following way

.*(?<!^InventTable)(?<!^VendTable)(?<!^CustTable)

or use regular expresseions within the brackets

.*(?<!^SysVersion.*)

16 May 2014

TDTT - Test Data Transfer Tool - Part1

The test data transfer tool is a good way to move test data from one environment to another. Always keep in mind that it transfers data from all companies. Always backup the target environment cause the import deletes all the records in tables that are part of the import.

The generall process is done in two steps. Export data from source environment and import data into target environment.

Export data from source environment

The procedure for exporting data consists of these general steps:

  1. Generate a Metadata.xml file. (This can be done on every machine running an AX 2012 R2 Client)
    1. Import the MetadataXMLGenerator.xpo into the environment where you want to export data from.
    2. After the import is done open the aot and run the job. This will take some time. After two cups of coffee you'll get an infolog with the path where the Manifext.xml is stored.
    3. Copy the generated Manifest.xml into the [Lists] folder of the test data transfer tool C:\Program Files(x86)\Microsoft Dynamics AX 2012 Test Data Transfer Tool (Beta)\[Lists]
  2. Determine which data to export (This must be done on the SQL Server)
    Check the Exclude….txt files to define what tables will be exported.
  3.  Run the tool (This must be done on the SQL Server)
    1. Open a command prompt.   
    2. Change directory
      cd "c:\Program Files (x86)\Microsoft Dynamics AX 2012 Test Data Transfer Tool (Beta)
    3. DP.exe Export E:\Temp\TDTT20140102 AX2012R2CU7_TEST
      DP.exe Export "folder" "db"
      This will also take 10 to 15 minutes depending on the performance of the SQL Server.
Import data into target Environment
  1. Run the tool (This must be done on the SQL Server)
    1. Open a command prompt.   
    2. Change directory
      cd "c:\Program Files (x86)\Microsoft Dynamics AX 2012 Test Data Transfer Tool (Beta)
    3. DP.exe Import E:\Temp\TDTT20140102 AX2012R2CU7_DEV
      DP.exe Import "folder" "db"

08 May 2014

Data Import Export Framework escape text qualifier

If you want to import text with the DIXF (DMF) that is delimited with a text qualifier you Need to take care that the text qualifier does not accure within the text.

1;"example "test" text";123

This will lead to an error. Actually Microsoft suggests to use a unique text qualifier. One possible Option is to use more than one character:

1;@@example "test" text@@;123

Another way to deal with this is to escape the occuring character within the text. Due to the fact that you cannot specifiy the escape string in AX I tried several ways to do the escape. \" is not working. Instead you have to double the character:

1;"example ""test"" text";123

This will Import the text example "test" text into the database.