Migration question

Topics: Core, Customizing Orchard, General, Installing Orchard
Sep 26, 2012 at 1:15 PM

I recently upgraded the staging version of my site to 1.5.1, from 1.4. As part the migration I have to also create a MenuWidget so my existing menu items get displayed. I didn't think this through during development because my development recipes blow the whole site away and build everything up from a custom recipe, and that recipe included a step to set up menu items and the MenuWidget. 

For now it's simple, i created a recipe to set up the MenuWidget and ran it from the command line on my staging environment.

I was wondering if there is a clean way to make sure recipes are run, and preferably done so in association with Migrations. For example, this deployment brought my site's main module to "migration version 2" via my Migrations.cs' UpdateFrom1() method. Is there a way to run my "UpdateFrom1-ImportMenuWidget" recipe as part of (or after) UpdateFrom1()?

If the above isn't possible, I'd like to hear how others are handling this kind of data update. I'm guessing programmatically as part of migrations? 

Also, does running bin\Orchard.exe after you deploy a new version of a module trigger migrations to run? Or does that only happen if you load a page of the website? 

Sep 30, 2012 at 9:50 PM

In principle, you should be able to run a recipe from a migration, yes. I'm pretty sure that yes, migrations will run from the command-line as well.