Moving Code Using Dynamics AX Temp Schema

By Jackie Olson | February 27, 2017

Moving code using dynamics ax temp schema

The reason for moving code using Dynamics AX temp schema is because you do not have a large window for downtime. By using this method, you would eliminate the time you would normally take to import a modelstore. Check out this article for more information on, How to: Create, Drop, or Reinitialize a Model Store .

This is how you would use Temp Schema for Dynamics AX:

In your TARGET environment where you would like the TempSchema created, do the following steps:

Note: You must first drain the target AOS before creating a new schema.

1. In Management util, run the command to create a new schema called TempSchema:

Axutil schema /schemaname:TempSchema

OR

Initialize-AXModelStore -SchemaName <NewSchema>

This will create a new schema against the database defined in your current active AX server configuration. Refer to this link for details https://technet.microsoft.com/en-us/library/hh433540.aspx

For example, my current active AX server configuration is pointing to MicrosoftDynamicsAX database. So my AX model db is MicrosoftDynamicsAX_Model

Dynamics AX Temp Schema

This is what the schema looks like before I ran the above axutil schema command – note: TempSchema does not exist.

The schema looks like before I ran the above axutil schema command

This is the command I ran to create the new schema called TempSchema:

This is the command I ran to create the new schema called TempSchema

When finished you will see the message ‘Model store schema successfully created.”

'Model store schema successfully created'

And in SQL management studio, on the MicrosoftDynamicsAX_model > Schemas, you will now see the new schema called TempSchema.

You will now see the new schema called TempSchema.

you will now see the new schema called TempSchema.

you will now see the new schema called TempSchema.

2. Next import the modelstorefile (this is the modelstore file you exported from the server with the changed/updated AX code) to the temporay schema.

You would do this on your TARGET environment at the same time when you are importing your modelstore to your TEST environment.

So, in management utilities on the AOS server of your Target environment run this command:

axutil importstore /file:modelstorefile.axmodelstore /schemaname:TempSchema /verbose

Or

Import-AXModelStore -File modelstorefile.axmodelstore -SchemaName TempSchema

NOTE:
The model store that you import to the non-default schema is not visible to Microsoft Dynamics AX.

This will cause the model db at the target to increase in size. So make sure you have enough disk space.

This is what I did as a test –

test

My model db size was around 8GB. After the importstore, the size was 14GB. Model log file size increased by about 3GB. These sizes may be different on your environment depending of how much code you have.

3. When you are ready to make the code in the TempSchema visible to AX (ie. Move to the dbo schema), you would do the following:

a. Drain the AOS, have all users logout of AX.
b. Shut down the AOSs and other services used by your Dynamics AX like Management reporter.
c. Clear the content in server\xppil folder for all the AOSs (:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL)
d. When steps above are completed, run the following command in axutil –

axutil importstore /apply:TempSchema /verbose

OR

Import-AXModelStore -Apply:TempSchema

This is what I did as a test –

test

It completed in about 5 seconds.

completed in about 5 seconds

In SQL management studio, if you now look at the tables under the AX_model database, you will notice the tempSchema.tablenames are no longer there. Only dbo.tablesnames exist now. Same as in programmability node in the AX_model database. TempSchema still exist as a schema under AX_Model> Security> Schema.

Notice the tempSchema.tablenames are no longer there.

e. Start up 1 AOS, run synchronize
f. When synchronize is completed, deploy reports etc (follow the normal process you would do for moving code from one environment to another using the import modelstore method).

4. You may use the following commands to remove the temporary or nondbo schema:

axutil schema /drop:TempSchema

Or

Initialize-AXModelStore –Drop TempSchema

Related Posts

Recommended Reading:

5.27.22 Dynamics GP

How to Run Drop Ship Sales in Dynamics GP

Need to Invoice the Customer before you get the invoice from the vendor? This The freight forwarder has contacted you […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Protecting G/L Accounts From Being Deleted

There are a lot of exciting New Features in Dynamics 365 Business Central 2022 Wave 1 Release to get excited […]

Read the Article
5.25.22 Financials

Rounding Numbers in Power Automate

  If you’ve ever tried to round numbers in Power Automate, you have probably already run into the issue there […]

Read the Article

Manage U.S. Use Tax on Purchase Orders in Dynamics 365 Finance and Operations

  Managing sales tax requirements on your business purchase can be complicated, but Dynamics 365 Finance and Operations can help […]

Read the Article
5.19.22 Dynamics CRM

How to Write a Great Support Ticket in the Stoneridge Support Portal

Submitting a support ticket through the Stoneridge Support Portal is a quick and effective way to get assistance for any […]

Read the Article

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X