Move AX 2012 to a different Server / Domain

As you probably know Microsoft Dynamics AX 2012 R2/R3 does not have a redeployment utility (like the Dynamics CRM deployment manager) meaning that if you want to move an AX Deployment from one domain to another – you’ll have to get your hands a little dirty.

Some important notes before we start :

  • You can use these steps also in AX 2012 – Just ignore the Modelstore database.
  • You can also use these steps to move a deployment in the same domain – ignore step 4.
  • You need to make sure that the AX installation version in the new server matches the installation
    on the previous server.
  • I’m assuming that you have the basic required knowledge in SQL Server, your Windows Serverenvironments and of course some AX 2012 architecture understanding to do these steps 🙂

Let’s go:

1. Open the SQL management studio and Backup your AX Databases [BusinessData Database + Modelstore Database] for example: AXProd + AXProd_model
2. Stop the AX Service on the new server and restore the databases in the new SQL server – You can restore them with different names just remember that they have to match – for example: AXProdNEW
3. In the SQL management studio run the following queries on the BusinessData Database (AXProdNEW):


— This will delete the AOSID & SERVERID of the previous installation and will
— repopulate the tables with the new server name when the AX service on the new server is started.

Also consider running:


— This will clear the Reporting Services properties form – you will need to reconfigure this
— later if you want to redeploy the reports.


— This will delete the batch server properties of the previous server – You should do this if
— the redeployment is in the same domain because the old server might be reachable by the new one and may use it as a batch server.


— This will delete the SMTP server parameters for sending emails

4. Now you need to configure your user in the AX Database in the new domain (You can skip this step if you re-deployed AX in the same domain).
Open CMD with “Run as admin” and type:

wmic useraccount where (name='your_windows_username' and domain='your_domain') get name,sid

Example: wmic useraccount where (name='administrator' and domain='contoso') get name,sid

Copy the SID to notepad.

In the SQL management studio run the following query on the BusinessData Database (AXProdNEW):

SET SID='your_sid', NETWORKALIAS='your_windows_username', NETWORKDOMAIN='your_domain', NAME='your_full_name'
WHERE ID = 'Admin'


SET SID='S-1-5-21-916693446-2822637979-541647007-1001', NETWORKALIAS='administrator', NETWORKDOMAIN='contoso', NAME='John TheAdmin'
WHERE ID = 'Admin'

— This will replace the AX Admin user to your user – you can modify this query to replace other
— users as well, or you can later add new users from the AX GUI.

5. Grant the AX AOS account permissions over the databases as follows:




You can identify the AOS account by going to the services on the application server (start->
services.msc) and check the Log On tab:

If you are using NETWORK SERVICES as the service account you will need to grant permissions to the machine$ account – Use the following query to do it:

CREATE LOGIN [Domain\axservername$] FROM WINDOWS

6. All done! Go to services on the application server and start the Microsoft Dynamics AX Service –
it might take a few minutes for it to start. Once it’s running – you can start the application.
If you have any issues starting the service check the server’s event log for clues, and if you have
any questions – feel free to post them here and i will do my best to help you out.

Further optional steps:

1. You should synchronize your Database to make sure everything is working properly.
2. If you want to deploy your reports – you need to fill the Report Servers form and then run the
following command from the Dynamics AX 2012 management Shell:

Publish-AXReport –ReportName *

I hope you find this post helpful! Good luck, Michael.

10 thoughts on “Move AX 2012 to a different Server / Domain

  1. Marcy

    Does this method work to bring up an existing server deployment in a new domain? We need to migrate our existing AX environments to the new domain but in my first attempt I could not create a new client configuration to start the UI because WCF could not be refreshed. This was after I had updated all domain and SID columns in the USER_INFO table and had successfully brought up the AOS. These instructions don’t appear to require new configuration files so I am curious how you were able to bring up the AX client in a new domain without that step?
    Thanks for any help you can give.

  2. Michael

    When writing this tutorial i took into consideration that you are moving the Database to a new server / domain – Meaning that the AX installation with it’s clients is already set-up in the destination environment. In this scenario we are just replacing the database with a new one – the clients are still connecting to the same AOS and don’t need to be reconfigured. What is the error you get when trying to refresh the WCF?


    1. Syed

      My case:
      Backup up AX databases from Server1 – Same domain and ax-admin user
      Restore AX databases into Server2 – Same domain and ax-admin user
      Run the scripts as above.
      Run the reports deployment
      Question is :
      How about my EP which i INSTALLED IN SERVER1.
      Do I need to regenerate the pages of SP/EP in Server2 from before.

  3. Marcy

    Thanks Michael, we are moving to a new domain–not new server+new domain. We want to try physically changing the domain for our existing servers and then bring up the instance in the new domain. I was successful in bringing up SQL Server and the AOS, but not the client, the error I am getting is “Unable to log on to Microsoft Dynamics AX.” Do you know of anyone who has done this ?

    1. Michael

      Hi Marcy

      This might be a bit tricky as there are many security related issues that might be missed when changing an already installed enviroment to a new domain – Please check the event log on the AOS server to see if there are any errors during the AOS service startup – event if it’s started successfully.
      Also there are 2 stored procedures inside the AX Database called CREATESERVERSESSIONS & CREATEUSERSESSIONS – Make sure that the AOS service account has Execute permissions on them.

      1. Marcy

        There were no errors at AOS startup, the only error is unable to login when trying to refresh WCF. This means I’m unable to create a working client configuration in the new domain. I find it hard to believe there isn’t a documented way to do this. Do you know anyone else who may know how to do this using existing machines and AX installations ? If there really is no way to do it, then we have to duplicate our entire AX architecture–both Production and non-production instances, and reinstall everything. That is a huge undertaking, to say the least.

  4. Marcy

    At this point I am wondering if I should delete the client from the server and reinstall the client only ? Even if I had to remove the AOS service and the client together, and reinstall both, that would be much less work than having to provision all new hardware, install the OS, install SQL Server, and install AX components including SharePoint, MR, and all our integrated apps like Sales Tax Office, BI360, &c. We basically would have to completely duplicate the entire AX environment as it exists here. Not excited about this prospect !

  5. Dipankar Paul (@diptouch)

    Nice tips Michael. Thanks for identifying core tables which needs a refresh for environment redeployment. The error Marcy was pointing out may have multiple reasons. Like unable to login to AX – might be due to pointing to a wrong AX configuration which occurs sometime a shared ax configuration file used as a configuration store in AX client, or user doesn’t exists in the DB. Secondly, WCF issue, in order to have successful WCF refresh, the full CIL needs to be performed in AX, Refresh all the services in AX (AIFServices form). Then try to refresh the WCF in the client configuration utility.

  6. Deepak Kalra

    I have one query regarding deployment from UAT to production per microosoft whitepaper we should import/export through Modelstore.whats your viewpoint on this.will this work same like modelstore as you explained above?
    Thanks in advance

    1. Michael

      Hi Deepak

      Exporting & importing the model store – copies only the model store (developments/code) to the new environment – Business data will not be transferred.
      The method above explains how to move a whole deployment from one server / domain to another.
      Import/Export model store is a good procedure to test developments between DEV \ UAT \ Pre-Prod environments


Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Facebook photo

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

Connecting to %s