D6-D8 migration: How did we skip certain content types from migration?
In one of our projects, there were 10-12 content types in D6 site but some of them were not being used anymore. So we had to skip them during migration. We wanted to skip those unwanted content types, their fields and content in those content types.
One option is generate the migrations using --configure-only option in migrate-upgrade drush command. Then export the generated migrations on file system. Afterwards we can remove the unwanted yml files for those unwanted content types and remove their dependencies, if any, from other content types in their yml files. This will help in skipping the migrations of certain content types. We can also make changes in the yml files as per our requirement like mapping of new fields with old field, process plugins for certain fields etc.
We used another approach. We used hook_migrate_prepare_row() in our custom module to skip the certain migrations. Following code helped us to skip the migrations of certain content types, their fields and data,
One option is generate the migrations using --configure-only option in migrate-upgrade drush command. Then export the generated migrations on file system. Afterwards we can remove the unwanted yml files for those unwanted content types and remove their dependencies, if any, from other content types in their yml files. This will help in skipping the migrations of certain content types. We can also make changes in the yml files as per our requirement like mapping of new fields with old field, process plugins for certain fields etc.
We used another approach. We used hook_migrate_prepare_row() in our custom module to skip the certain migrations. Following code helped us to skip the migrations of certain content types, their fields and data,

Comments