Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Import a model doesn't modify the BD?

Posted on by 447

Hello!

I have two equals environments but on of them has 2 shared projects (for example) with a new code and new fields in a table.

I can export the projects as XPO and import them in the second environment, but if instead 2 projects were 50 or 100, I don't want to export one by one...

I had thought about importing and exporting the model but I see that when I import the model, its appears many errors saying that some field daoesn't exists en datatable, etc.

What is the best way to do this?

*This post is locked for comments

  • vanels Profile Picture
    vanels 447 on at
    RE: Import a model doesn't modify the BD?

    Ok, Martín.

    I am going to think about everything and see my first step (code version, branches...).

    I see that there is my principal problem.

    Many thanks for your time and your help!!!

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Import a model doesn't modify the BD?

    If you deploy a model, you get everything in the model. If you have three features there, you'll get all three. A solution, which I explained above, is maintaining two versions of the model. Branches in version control can make it very easy.

    You could also move code to Test manually by .xpo files and deploy models/modelstore from to Staging and Production, but you should think about how you'll version code in Test.

    When you have an automated build taking code from a given branch and generating a model, it's then very easy to take the model and install it. You don't need any manual development (code merge) in non-development environments, you have everything covered by version control, automated builds will detect problems (such as missing objects) before deployment and so on...

  • vanels Profile Picture
    vanels 447 on at
    RE: Import a model doesn't modify the BD?

    I wanted to say that in the first step, from developer environment to test (or in my case, staging) if we work importing the model, i'm going to see some projects that I am developing in the developer environment, in the target environment...

    I can stay working in 3 projects but only want to test one of them...

    This step is what confuse me.

    Staging to production, working with modelstore, I think that is clear for me.

    Thanks Martin!

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Import a model doesn't modify the BD?

    I'm sorry, but I don't understand the sentence "I would have the projects in development also in this environment". You said you would have four environments; which of the other three is "this"? What would you deploy there?

    You can call the test environment "Staging" and deploy directly from there if you want (although I prefer a separate pre-production environment independent on all test environments).

  • vanels Profile Picture
    vanels 447 on at
    RE: Import a model doesn't modify the BD?

    My idea was to develop in the development environment, to pass the updates to staging so that people can test them and publish them in production.

    However, if I had the 4 environments and without branches as you comment, working with models, if I understood correctly I would have the projects in development also in this environment, is that true?

    Thank you for your explanations.

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Import a model doesn't modify the BD?

    If you want different code in development and testing, you can use two branching in version control, e.g. Dev and Main. When a feature is ready for release, promote it from Dev to Main. When you want to do a release, take code from Main (while you may have work in progress in Dev).

    What you completely miss is an environment for testing. You can't reasonably test in Dev, because code there isn't the same thing as what you'll deliver to production.

    If you deploy something and it doesn't even compile, it either never worked or you've deployed a wrong thing. It can easily happen with XPOs, e.g. when you forget an object or it doesn't get imported correctly - that's one of reasons why you shouldn't do it.

  • vanels Profile Picture
    vanels 447 on at
    RE: Import a model doesn't modify the BD?

    Hi,

    I have already read the article recommended by Martin and there are things that I don't understand very well.

    When it speak about deploy models on a test environment, I understand that I will have all the projects that I am developing in the development environment, but I would only like to have the ones already finished and that I want to take to production... no?

    What I did with XPOs so far, even if it is not right, allowed me to update only what I wanted.

    Afterwards, from test to staging it seems that the best way is to import the model, but in addition to having to compile the application, if we follow the criteria of the previous step, we would also have projects in development that I do not want that are still in staging.

    Say that I currently have a development environment with all the projects and the production environment.

    I have set up a new development environment where I want to take all the projects and another staging environment, so I will work with 3 environments in total ...

    And after all I do not understand what is the best way because even doing tests with a project that creates a field in a table of the BD, I made the export / import of the model and compiling receipt errors...

    I am lost! :|

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Import a model doesn't modify the BD?

    All options are described in the whitepaper that Martin mentioned above.

  • vanels Profile Picture
    vanels 447 on at
    RE: Import a model doesn't modify the BD?

    Ok, I am trying now with the model (but deleting the actual before...) and after that I try this and tell you.

    I'd like to see all options to decide which is the best.

    We made uploads to production every week and if I work with a model and it obligate me to do an application and CIL compile... maybe it's not the best

    Ok, I tell you something.

    Thanks.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Import a model doesn't modify the BD?

    1) Make sure that you can compile the source environment succesfully, then generate full CIL and do a database sync.

    2) Export modelstore from source environment

    3) Import modelstore into target environment

    4) Synchronize the database in the target environment. No compilation or CIL generation is needed.

    Does this work for you?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans