Recipes vs Migrations

Topics: Customizing Orchard
Jan 26, 2015 at 9:32 PM
Hello all,

We've recently started using Orchard CMS at my company as a tool to aid our development, however we're debating at the best way to move content types/parts between environments. To clarify the discussion revolves solely around content types/parts that would not otherwise require code to create (i.e. no logic surrounds them).

Assuming you overlook recreating the types on each environment, the two main ways of moving types between environments would appear to be Recipes and Migrations (stored in a common module (perhaps?)). However, overall we have been unable to agree on which the best approach would be, as there are several pros/cons to both approaches, and we're interested to see what the opinions of the Orchard community and of those with more experience than us.

Please can you help us and advise as to your experiences?

Thank you,

Jan 27, 2015 at 1:18 AM
users is also a contenttype in orchard. It wouldnt make sense to put it in a recipe.
So if your module can not work without a certain content type, put it in migrations.
for other things, put it in recipe.
Jan 27, 2015 at 8:32 PM
Edited Jan 27, 2015 at 8:33 PM
I think of it like this.

Does your module require that Content Type/Part? Yes - Then it should be in a migration. If not, recipe.

A Recipe is a manifest of your site... and therefore anything outside of a migration fits in there.

One other thing to note, modules increase memory on your system. If you use a module just to run a migration, you will have Orchard holding that in memory for no reason... Modules are there to provide functionality. If you just have a migration I would argue that you have a useless module.

On the note of a common module. I use them sometimes when I have a small feature, something that is providing functionality to Orchard.

I know its hard to want to do everything in code, and I know has developer that the way our brains think, but in this instance, personally, going down the migration route in this instance will cause you headaches later on.
Feb 4, 2015 at 3:54 PM
Thank you both for your replies - it's much appreciated - I'll take them into a team discussion we are having this week.