[Ax 2012] Moving model from one layer to another (Step by Step guide)

Ax 2012 allows moving code within the same layer. MSDN has a topic Maintaining Installation-Specific Element IDs and Element Handles [AX 2012] which does describe the issue in a short description.

With Ax 2009 this is not a big issue as code can be exported as XPO’s with ID’s and moved into another layer. Ax 2012 creates ID’s which are installation specific, and doesn’t let importing or exporting XPO’s with Id.

This is my take on a step by step procedure to achieve this.

Step 1. Create a model and move all the objects that you want to move out of the layer.

Step 2. Create a project of this model and export the project as an xpo.

Step 3. Backup the database and delete the old model created in step 1 (Model and Data databases)

Step 4. Synchronize the database from the AOT. This will delete the data but we will retrieve it later.

Step 5. Import the xpo from step 2 (Into the New Layer)

Step 6. Synchronize the database.

Step 7. Export this new model.

Step 8. Restore the databases that was backed up from step 3

Step 9. Import the new model (step 7), Synchronize and compile
This restores the I’d values of the objects and tables / fields. So no data will be lost

Step 10. Delete old model, compile / synchronize.

This should successfully move the code into the new layer and you won’t loose any data.


7 thoughts on “[Ax 2012] Moving model from one layer to another (Step by Step guide)

  1. Hi Shashi,

    I have very weird requirement.
    There is one environment having two companies( Comp1 & Comp2) having live transactions going on.
    Now there is one different environment with company Comp3 having live transactions.
    Actually these all companies are of same management and now they want in the same environment, like having Comp1, comp2 and comp3 in the same environment.Also the data will not be shared where comp3 is present.
    How do I do the data migration of comp1 and comp2 in the new envrionment. as the tables will not be the shared table in comp3, whereas the data in comp1 and comp2 is shared.

    can you please suggest ?


  2. Hello Shashi,

    What kind of database should I backup and restore in step 3 and step 8. I’m a little bit confuse on this. There are 3 database on AX Server DB: including data and model database. Could you help me to clarify this?
    Thank you.


    1. Hi, You should always take a backup of the model and the data databases. 2012 applications have 2 databases we are concerned with: The Model database and the data. (The model ends with _model). Always backup both these databases. In Step 8, restore both the databases. Also you will actually need to export the Older model as well (i.e. the ones that is to be removed, so that you can separate the objects). Its been a while since ive done this. If you are facing any issues, send me a message separately.


Leave a Reply / Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s