Update: this answer is probably fine for D8 but not D7.
Using the migrate_plus module, I was able to specify shared configuration for about a dozen different feeds that needed to be given separate taxonomies upon import based on which organization's media I was importing. I created a group with my
process configuration, then created individual importers for each feed with just the configuration that was specific to that feed. If I wanted to import them all at once I could run
drush mi --group=<group_name>, and if I wanted to roll back a single feed I could run
drush migrate-rollback <migration_name>. The only tedious part for me was creating a dozen nearly-identical migrations.
So, for example, here's a group definition for an Twitter importer:
# etc. etc.
Then a few migrations like this:
# this changes from migration to migration
# this also changes; works because the group's shared config specifies the plugin
It's annoying setting it all up on the frontend but after the third one you get pretty quick at copy/pasting the template and replacing one or two variables.
So I guess to answer your question:
How can I create individual migration groups - one for each XLM file, without having to write a new migration class for each file?
I'm not sure you can get around that...but you can abstract a lot of the repeated configuration out of each individual file using shared configurations. You can maybe further refine the process by having a template file with placeholder variables, duplicating the file, and using
sed on the new file to replace filenames:
cp migration_template.yml migrate_plus.migration.migrate_xml1.yml
sed -i "s/filenameplaceholder/file1\.xml/g" migrate_plus.migration.migrate_xml1.yml
Questionsgroup has, say, 10 migrations in it, each representing a single XML file, you can migrate or roll back either the whole group or an individual migration within the group. I'm not sure what splitting your one group into a bunch of smaller groups does for you.