Managing new version of enabled feature that has new dependency on disabled feature

Topics: Administration, Core, Writing modules
Aug 22, 2013 at 5:43 PM
Hi,

Let's say I've got a feature currently enabled in prod. I want to deploy a new version that has dependency on a new module feature by using an injected service. At the moment I need to disable the current feature version then deploy the new version and the new module then enable the new version of the feature so autofac doesn't get angry.

Is there any way to automate this process so that I can just deploy the new version and the new module and Orchard detects a new dependency in the manifest, disables the feature and re-enables it so I don't have to do it manually or via a script?
Coordinator
Aug 22, 2013 at 7:30 PM
The only thing you can do is add a recipe.
Aug 23, 2013 at 10:37 AM
Didn't think of using recipes that way. Thanks for the tip.

I'll probably create a specific module that contains recipes to do this kind of stuff.
Pretty similar to what is explained in this article:
http://www.davidhayden.me/blog/run-orchard-recipes-from-orchard-dashboard-in-orchard-cms-1.7

Another one:
I made up a recovery procedure in case an updated module (in same scenario) is not disabled before and autofac gets angry.
  1. Delete records from DB:
    delete [dbo].[Settings_ShellFeatureStateRecord] where [Name] = 'UpdatedModule'
    delete [dbo].[Settings_ShellFeatureRecord] where [Name] = 'UpdatedModule'
  2. Delete App_Data\cache.dat
  3. Enable UpdatedModule via CLI or Admin UI.
Is this procedure correct and enough to keep Orchard clean?
Coordinator
Aug 23, 2013 at 8:47 PM
I wouldn't do direct db manipulation, except on a disposable dev database.
Sep 20, 2013 at 3:37 PM
Hi Bertrand - while I agree that you would not want to, sometimes you are left with absolutely no choice. You have a live site in a broken position and your only recourse is to fix in situ or delete the entire database.

Francois - this looks roughly right. Would someone from the core team be able to verify a set of steps for this "emergency recovery" type of process. It would be extremely helpful, as the situation mentioned about happens often if you tend to refactor (and then miss something).