You can achieve this via a custom migration module, this way you have full control over what will be migrated, note the bold text:
- Create the migrations using drush migrate-upgrade --configure-only as discussed in Upgrade Using Drush
- Make sure you have aconfig/syncdirectory, to which the next step will write
- Export the migrations using drush config:export
- Create your custom migration module
- Copy only the YML files you want to use from the config/sync directory into the config/install directory of your new custom module, editing them to remove the uuid values and to edit the id, group, label, and other values as needed
- In the config/install directory of your new custom module, make a new migrate_plus.migration_group.your_module.yml file for your new migration group.
from official handbook: https://www.drupal.org/docs/8/upgrade/customize-migrations-when-upgrading-to-drupal-8
You can also rename the fields. Further processing can happen in hook_migrate_prepare_row()
, hook_migration_plugins_alter()
, or even a custom process plugin.
update
Please note that you will not be exporting configuration from a site and moving it to other site. Config export is a bad name here. Read it as generate migration template.
When you generated your template (aka, exported), you handpick those fields, entities and configuration that you want from all the available generated files, put them in a custom module, say my_custom_mig
, enable it, and run it's migration.
foreach
inhook_update_N
is no option?