Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Contributed farmOS 1.x modules that add their own record types (assets, logs, vocabularies, etc) will need to provide migrations for farmOS 2.x
Remaining tasks
Design core farmOS 2.x migrations with contrib in mind- Provide guidance/examples for contrib migrations
Comments
Comment #2
m.stentaFor lack of a better place (and lack of time), pasting some notes I wrote directly in the
farm_migrate_asset
migration - relevant to the contrib migration considerations...Context: while testing asset migrations, and specifically the parent asset reference field, some assets were failing because the stub that was created for them didn't have a bundle set. Setting
default_value: stub
allowed the migration to work, but made merealize flaws in the approach/goals:
Comment #3
m.stentaI have refactored the core farmOS 1.x migrations based on the thoughts in my previous comment:
This approach makes it relatively easy for contrib modules to add their own bundle-specific migrations. They just need to make sure to put them in the appropriate
migration_group
:farm_migrate_asset
farm_migrate_log
farm_migrate_taxonomy
If the bundles define any additional reference fields, these should be in separate migrations that are part of the
farm_migrate_reference
group, to ensure that they run AFTER the bundle migrations.The last thing to figure out is: right now the reference migrations (eg: asset parent field, and asset and equipment reference fields on logs) have hard-coded lists of bundle specific migrations that they will look for IDs in. This means that if a contrib module adds their own bundle migrations, these also need to be added to the lists in the reference migrations configs.
Not sure what the best way to do that is... setting this issue to "Needs work".
Comment #4
m.stentaOne idea might be to provide our own process plugin that extends the
migration_lookup
class, and makes it possible to search all migrations in a particular group.So instead of:
It might be:
That could be a nice general-purpose process plugin. Maybe worth sketching it up and contributing as a patch to the Migrate Plus module.
Comment #5
m.stentaOK! I was able to get that working. I created the new process plugin in the
farm_migrate
module (asfarm_migration_group_lookup
), but I also opened this issue to explore adding it tomigrate_plus
upstream: https://gitlab.com/drupalspoons/migrate_plus/-/issues/240Comment #6
m.stentaComment #7
m.stentaComment #8
m.stentaI think we can close this. We're developing migrations in the contrib modules that we maintain, and these serve as examples for other contrib modules. I don't think we need dedicated documentation for this on docs.farmos.org.