web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 Export and Import ModelStore

(0) ShareShare
ReportReport
Posted on by

I have recently tried the new way of pushing the latest codes to the production environment using the ModelStore method.

I am importing the ModelStore directly to the default schema. However, this is my experience thus far:

1) the overall import time took almost 1 hour to complete (Xeon Dual Core Processor with 12GB memory, Windows Server 2008 R2 64 bit OS).

2) The database log file grew until 17-19GB in size after the import, while the actual data file size was only approx. 5GB (customer data is only within the 1GB size range).

3) Reading

My question is, does it really take that long to import a ModelStore? during the import, I have already shut down the AOS service and there is no existing processes that is running at the background which I believe could impact the performance of the ModelStore import. There is one optimization step recommended by microsoft before importing ModelStore, but I am reluctant to try that step at the moment because the changes is less than 5% of the existing target ModelStore (Microsoft recommends this step only if you have more than 50% of changes). Should I try the optimization step in hopes that I would decrease the time to say 50% faster?

And for the Database Log, what is the normal or recommended practice that should be put in place to manage the size of the database file? I am thinking on my own, truncating the log file would not do good in the long run since it will create fragmentation and worst still, usually in the Production environment, you will be running Full recovery model which will not allow you to truncate the log file (SQL Server 2008 R2), unless if you would want to set it to Simple, truncate it and setting it back to Full - but again this will cause fragmentation? So do you just perform your normal backup rounds and maintain the actual physical log file size to be in the 17-20GB manner at all times? Just wanted to know what is the usual way for those who is implementing the ModelStore export/import for code deployment.

I apologize for the long-winded writing. But would like to put this up as a constructive topic to be discussed among the community. Hope to receive some insights on this. thanks.

Regards,

Jason Lee

*This post is locked for comments

I have the same question (0)
  • Robert Badawy Profile Picture
    on at

    Jason,

    Can you please provide the syntax you used (AxUTil) to import the model store. It should not that long to import it.

    Thanks

    Robert

  • Margo Crandall Profile Picture
    on at

    Hi Jason,

    I’m a member of the team that worked on the white paper about moving code to a production environment by importing the model store.

    The team has discussed the issues that you are seeing, and we have some comments and questions.

    Question: can you post the precise syntax that you are using for import modelstore? We’re wondering whether you are running with –verbose, which may slow things down.

    For comments on each section of your post, see below:

    1) the overall import time took almost 1 hour to complete (Xeon Dual Core Processor with 12GB memory, Windows Server 2008 R2 64 bit OS).

    --The import time that you are seeing is much longer than what we are experiencing on similar equipment. Our experience is that it shouldn’t take more than 15 minutes on a fair hardware setup, unless you have limited the memory usage of SQL server or have a very slow disk.

    2) The database log file grew until 17-19GB in size after the import, while the actual data file size was only approx. 5GB (customer data is only within the 1GB size range).

    --This is to be expected, because the import modelstore operation is processed within one transaction that does massive data updates and deletes.

    There is one optimization step recommended by microsoft before importing ModelStore, but I am reluctant to try that step at the moment because the changes is less than 5% of the existing target ModelStore (Microsoft recommends this step only if you have more than 50% of changes). Should I try the optimization step in hopes that I would decrease the time to say 50% faster?

    --To be clear—optimization is triggered automatically when there is greater than 50% change. Running optimization before importing the modelstore shouldn’t harm anything, and may help. It will reindex the model store and shrink the database file. If you do run optimize-modelstore, we do not think that you will necessarily decrease the time required by 50%, but it may help.

    And for the Database Log, what is the normal or recommended practice that should be put in place to manage the size of the database file? I am thinking on my own, truncating the log file would not do good in the long run since it will create fragmentation and worst still, usually in the Production environment, you will be running Full recovery model which will not allow you to truncate the log file (SQL Server 2008 R2), unless if you would want to set it to Simple, truncate it and setting it back to Full - but again this will cause fragmentation? So do you just perform your normal backup rounds and maintain the actual physical log file size to be in the 17-20GB manner at all times? Just wanted to know what is the usual way for those who is implementing the ModelStore export/import for code deployment.

    --We agree that truncating the log file is not a good idea in general in a production environment, but right after importing the model store, truncation should not be a problem.

  • Joanna Demetriou Profile Picture
    355 on at

    Good afternoon!

    Margo thanks for the excellent post.

    That clarifies a lot of things.

    Would really appreciate your answer on the below:

    1) How can we estimate the max size of the log file during model store import? (a rough estimation to ensure that the server has enough disk space). Can it be estimated based on the model database size? E.g. 150% of model DB size?

    2) In case the model store import fails and needs to be run again.

    What is the recommended process in order to avoid any issues?

    E.g. a. Drop temporary schema (if used)

          b. Backup model DB log file

          c. Shrink model DB log file

    Would the above steps be sufficient?

    Thanking you in advance

    Joanna D.

  • dolee Profile Picture
    11,279 on at

    Hi,

    I don't have an answer for #1. But for #2, I'd recommend doing a full backup before importing a modelstore. Should anything went wrong, restore the backup and try again.

  • Bashir Ahmad Profile Picture
    5,248 on at

    Validate permissions

       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

    For further detail follow the link:

    technet.microsoft.com/.../hh433530.aspx

  • Joanna Demetriou Profile Picture
    355 on at

    Hi Dominic

    Thanks a lot for the reply.

    I believe that a restore shouldn't be necessary since we are importing to a temporary schema and not to the dbo schema.

  • Robert Badawy Profile Picture
    on at

    1) From in-place upgrade experience we would recommend at least 30 GB server disk space.

    2) I would do

    a. Drop any schema that is not “DBO”

    b. Shrink database and log file

    c. Backup database and log file

    d. Import it again

  • rahul dev Profile Picture
    1,107 on at

    guys i have a query regarding DB Log:

    as i see during modlestore import our Log file expands, now its complete and every transaction commited. but log file still in big size. can anyone put light here!!!!

    Thanks

    Rahul Dev

  • Beat Profile Picture
    1,006 on at

    Hi, you need to shrink the log file using SQL Server Management Studio.

    Right click the model db > Tasks > Shrink > Files

    Select File type: Log

    Shrink action: Release unused space

    br

    Beat

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans