Walkthrough: Upgrading a Model

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

This walkthrough describes how to upgrade an existing model. To upgrade a model, you import the modified model over the existing model. This topic assumes that you have already modified the model in the Application Object Tree (AOT), and that you have created an .axmodel file.

Warning

In Microsoft Dynamics AX 2012, element IDs and element handles are assigned during installation. Therefore, you must avoid randomizing element IDs and element handles when you install models. In general, never delete a model and then reinstall it. Always install a model over an existing model. For more information, see Maintaining Installation-Specific Element IDs and Element Handles.

We recommend that you observe the following best practices:

  • Do not delete a model, and then reimport it. Instead, import the model over the existing model.

  • Before you import a model or model store, back up the database on the target system.

Prerequisites

Drain client connections and validate permissions

  1. Drain the client connections that are connected to the Application Object Server (AOS) instance that you are working with. For more information, see Drain users from an AOS.

  2. Validate that you have appropriate permissions to work with the model store:

    • Administrative permissions on the local computer

    • System Administrator rights in Microsoft Dynamics AX

    • In Microsoft SQL Server:

      • Membership in the Securityadmin server role on the SQL Server instance

      • Membership in the db_owner role in the Microsoft Dynamics AX database

Walkthrough: Upgrade a model (Windows PowerShell)

Export the .axmodel file (Windows PowerShell)

  1. On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.

  2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.

    Export-AXModel –Model <name> -File <Filename.axmodel> -Details
    

    This command exports the specified model to a file that has the specified file name.

Import the .axmodel file (Windows PowerShell)

  1. On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.

  2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.

    Install-AXModel -File <Filename.axmodel> -Details
    

    This command installs the specified file in the same layer that it was exported from.

    If the installation fails because of a conflict, we recommend that you rerun the cmdlet. When you rerun the cmdlet, use the –Conflict Push option to push the element that has the conflict to the related update layer. You can then resolve the conflict. For more information, see How to: Resolve Conflicts After Importing a Model.

Walkthrough: Upgrade a model (AXUtil)

Export the .axmodel file (AXUtil)

  1. On the Start menu, click Command prompt.

  2. Navigate to the directory for the management utilities. Typically, the location of this directory is %ProgramFiles%\Microsoft Dynamics AX\60\ManagementUtilities.

  3. At the command prompt, type the following command, and then press ENTER.

    axutil export /model:<modelname> /file:<filename> /verbose
    

Import the .axmodel file (AXUtil)

  1. On the Start menu, click Command prompt.

  2. Navigate to the directory for the management utilities. Typically, the location of this directory is %ProgramFiles%\Microsoft Dynamics AX\60\ManagementUtilities.

  3. At the command prompt, type the following command, and then press ENTER.

    axutil import /file:<filename> /verbose
    

    This command installs the specified file in the same layer that it was exported from.

    If the installation fails because of a conflict, we recommend that you rerun the command. When you rerun the command, use the /conflict:push option to push the element that has the conflict to the related update layer. You can then resolve the conflict. For more information, see How to: Resolve Conflicts After Importing a Model.

See also

Export-AXModel

Install-AXModel

Models, Layers, and the Model Store

AxUtil and Windows PowerShell Commands for Deploying Models

Administering Microsoft Dynamics AX by using Windows PowerShell

Windows PowerShell for Microsoft Dynamics AX