Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Prod deployment restor...
Finance forum
Suggested answer

Prod deployment restore previous deployment

Posted on by 462

hi,

I have a requirement to move the UAT deployed tasks to prod envt. I can mark the last deployed package and move the changes to Prod.

The issue is that there is no proper list maintained on the objects deployed in UAT till now and hence it will move all the objects to Prod. I know that we can check history etc.

Since there is an urgent need to move a custom job to prod on very high priority so we will have to move all pending changes of UAT to prod and I would like to know that lets say the previous deployment done in Prod was on 20th Nov as DEP20 and today I do another deployment DEP29.

I will execute the custom job and later on is there a way that I can restore the DEP20 . I see that it shows the schedule button as active however I need to be sure as it is prod . Will it override the system with old changes as it is or there can be an issue?

eg. DEP20 - 10 new fields

        DEP29 - 5 new fields

on again restore of DEP20 after applyind DEP29 will it show me 10 new fields or all the 15 new fields.

I think it should show only 10 new fiels but want to be sure on this.,

Also is there a way to move only a specific change to Prod without doing rollback of other pending objects from UAT ?

Thanks,,

VK

  • Martin Dráb Profile Picture
    Martin Dráb 225,862 Super User on at
    RE: Prod deployment restore previous deployment

    It would be a new branch, but not a replica of Dev, because Dev isn't what you deploy to production. You should create a new branch from Main, but not from the current state (which includes C1 and C2). You should create a branch from the version that you've deployed to production, because that's the version you want to work with.

    Maybe rolling back those changesets in Main will be easier for you at the moment.

    But you should start thinking about a process that you'll use if you need to apply to hotfix to production while you're testing new changes in Main. That's exactly what such a hotfix branch is for.

  • vicky1234 Profile Picture
    vicky1234 462 on at
    RE: Prod deployment restore previous deployment

    hi Martin,

    Thanks for the reply.
    I have not understood properly can you please share some more insight.
    pastedimage1669816997250v1.png

    In the above image I have 3 envts dev,uat and prod and on completing the development I am merging the code from Dev to Main branch and later on pipeline gets executed and the package is uploaded to Asset library and applied to UAT envt. Further if it is approved then I will mark is as release candidate and then apply to prod envt.
    The problem over here is that client wants a changeset C3 to be applied in Prod , 
    One way is to rollback c1,c2 and then checkin C1 to UAT and then apply to Prod . -> I dont want to do this one as there is some concern from client end,
    Your reply. :
    "creating a new branch from the version of code used for DEP20 and adding the job there. " -> How do I create a new branch from this version , do you mean to add a new branch in case of the above screenshot Dev, Main and a hotfix? and hotfix will be replica of dev and later on also merge the C3 changeset. 
    There can be "N" iteration of changesets.
    Kindly share your inputs.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,513 Super User on at
    RE: Prod deployment restore previous deployment

    Hi Vicky,

    To answer the questions related to the custom x++ scripts:

    1) Yes, the deployable package should contain only 1 object: the script. To be able to achieve that, you must create a new model with the script.

    2) As stated in the documentation, it should contain one class with the script only. You can't add more elements in the package. In that case, the custom script will not be imported. For creating new fields, you have to use the regular deployable packages. When you want to add a field and then run the script, Martin provided the best suggestion earlier.

    I haven't tried reading an Excel file with custom scripts myself.  

  • vicky1234 Profile Picture
    vicky1234 462 on at
    RE: Prod deployment restore previous deployment

    Hi Andre,
    Thanks for the quick reply.
    Wrt creating the custom x++ jobs and deploying to prod environment, I have a few queries if you can help please.
    1) while creating a deployable package is it necessary to create a new model ?
    2) If I create the deployable package with the same existing model in which all customizations are WIP then, will it also create or update other objects as well or it will only consider the project having a sample class in it..
    eg. ModelName : ModelABC
    So in ModelABC I have a table "DemoTable" and Salestable with new field "FieldSOABC" which is not moved to Prod or UAT environments.
    In this case when I create a new Project -> SolnABC with class - > SampleClassDeployABC only, and create the package with model "ModelABC" then will it create a new field "FieldSOABC" in SO table in Prod envt if the script is executed via the "custom X++ scripts".

    Also does it allows updating records via an excel or its just runs in no UI format.

    Thanks,

    VK

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,513 Super User on at
    RE: Prod deployment restore previous deployment

    Hi Vicky,

    Martin did provide already the thoughts to work with (release) branches to get control on what and when you release.

    Apart from this, if the job is about correcting some data, you can also consider moving the job to another model and create a deployable package with only this runnable class. You can use the custom X++ scripts with zero downtime feature to run the job then. Ensure you test it in a non-production environment first as some updates might not work. I have experiences issues with number sequences.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 225,862 Super User on at
    RE: Prod deployment restore previous deployment

    The right way is creating a new branch from the version of code used for DEP20 and adding the job there. Then configure a build agent for this branch and let it create a deployable package and deploy it in the usual way. If the job should become a part of the normal codebase, merge the change from the hotfix branch to the branch(es) you usually use.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,513 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans