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
AXProdNEW_model.
3. In the SQL management studio run the following queries on the BusinessData Database (AXProdNEW):

DELETE FROM SYSSERVERCONFIG
DELETE FROM SYSSERVERCONFIG

— 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:

DELETE FROM SRSSERVERS

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

DELETE FROM BATCHSERVERGROUP
DELETE FROM BATCHSERVERCONFIG

— 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.

DELETE FROM SYSEMAILPARAMETERS

— 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):

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

Example:

UPDATE USERINFO
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:
AXProdNEW:
db_datareader
db_datawriter
db_ddladmin
public

axpermissions1

AXProdNEW_model:
public

axpermissions2

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

axservices1
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

    Hi,
    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.
    Marcy

    Reply
  2. Michael

    Hi,
    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?

    Michael

    Reply
    1. Syed

      Hi,
      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.
      Regards

      Reply
  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 ?

    Reply
    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.

      Reply
      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 !

    Reply
  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.

    Reply
  6. Deepak Kalra

    I have one query regarding deployment from UAT to production server.as 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

    Reply
    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

      Reply

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s