Problem/Motivation
The removal of extension Migrate Drupal was approved in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.
Migrate Drupal is not being moved to contrib.
Remaining tasks
- ✅ Remove most of the extension. Keep only the info file and uninstall hook so sites that have it around can uninstall it. Mark it
lifecycle: obsoleteso new sites don't install it. Add a hook_update_N() to uninstall the module. - ✅ Remove references from
core/phpstan-baseline.neon. - ✅ Spelling words have not been removed. This is better done in a dictionary rebuild before 12.0 beta, I guess.
- ✅ Removed exclusion of migrate drumps from cspell.,json
- ✅ Add the extension to the relevant removed list, either DRUPAL_CORE_REMOVED_MODULE_LIST or DRUPAL_CORE_REMOVED_THEME_LIST, in system.install.
- Check for references in @todo.
✅ core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php - this was to test a hidden dependency on migrate drupal in the migrate module. So, this can be deleted.
✅ core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php. - changed the test to not rely on the locale module and the legacy source plugin, Variable.
✅ Add both migrate_drupal and migrate_drupal_ui to DRUPAL_CORE_REMOVED_MODULE_LIST. The latter was missed in #3574714: Remove Migrate Drupal UI from core
Key things to Review
The changed help text in the Migrate module.
MigrationPluginConfigurationTest.php.
Commands used
Listing here the various bash commands I used to remove Migrate Drupal. Each command was run by hand, I never put it all into a script. These removed the bulk of the files.
# MigrateField Plugins
git grep -l '\#\[MigrateField' | xargs rm
# List of plugins taken from the change records
cat plugin-remove.txt | xargs rm
# The migration yml
find . -depth -type d -name migrations -not -path '*/migrate/*' -not -path '*/migrate_drupal_ui/*' -exec rm -rf {} \;
# Remove migrate 'source' directories
find . -depth -type d -name source -not -path '*/core/modules/migrate/*' -not -path '*/migrate_drupal/*' -not -path '*/migrate_drupal_ui/*' -not -path '*/node_modules/*' -exec rm -rf {} \;
# Remove Kernel tests
find core -depth -type d -name Migrate -not -path '*/core/modules/migrate*' -not -path '*/migrate_drupal*' -not -path '*/migrate_drupal_ui*' -not -path '*/node_modules/*' -exec rm -rf {} \;
# Remove d6 and d7 directories
find core -depth -type d -name d6 -not -path 'core/modules/migrate*' -not -path '*/migrate_drupal*' -not -path 'core/node_modules/*' -exec rm -rf {} \;
find core -depth -type d -name d7 -not -path 'core/modules/migrate*' -not -path '*/migrate_drupal*' -not -path 'core/node_modules/*' -exec rm -rf {} \;
# Remove files starting with 'D6' or 'D7'.
find . -name D6\*.php -exec rm {} \;
find . -name D7\*.php -exec rm {} \;
# Remove more tests
find core/modules/*/tests -depth -type d -name migrate -not -path 'core/modules/migrate*' -not -path '*/migrate_drupal*' -not -path 'core/node_modules/*' -not -path 'core/modules/menu_link_content/*' -exec rm -rf {} \;
# Remove field module process plugins
find core/modules/field -depth -type d -name migrate -exec rm -rf {} \;
Release notes snippet
The Migrate Drupal module is removed.
The Migrate Drupal module was deprecated in Drupal 11.4.0. There is no replacement contributed module.
Issue fork drupal-3572280
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3572280-remove-migrate-drupal
changes, plain diff MR !14693
Comments
Comment #3
quietone commentedIt look like there are two tests still integrated with Migrate Drupal.
Comment #4
catchI don't think I've ever seen a core diffstat as dramatic as
Actual migrate_drupal we should mark obsolete rather than remove entirely, so that it can be cleanly uninstalled in case sites have left it enabled. edit: see the first item on https://www.drupal.org/about/core/policies/core-change-policies/how-to-d... for how.
Comment #5
gábor hojtsyElaborated in issue summary on what "keeping it in core" means in this context. Keeping uninstall code and the info file basically.
Comment #6
catchComment #7
catchRe: #3.
I think we should remove this test module and
MigrateSourceDiscoveryTest. This is part of the whole tangle of issues around #2786355: Convert multiple provider plugin work from migrate into plugin dependencies in core. The bc layer itself can go with the issue that removes that (not sure if we have an explicit issue for that yet though).This looks like it could be copied to migrate module and used from there.
Comment #8
catch#3573895: Fix test integrations using migrate_drupal is in.
Comment #9
quietone commentedComment #10
quietone commentedComment #11
catch#3574714: Remove Migrate Drupal UI from core is in.
Comment #12
quietone commentedComment #13
quietone commentedcore/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php - this was to test a hidden dependency on migrate drupal in the migrate module. So, this can be deleted.
I am checking the others now.
Comment #14
quietone commentedcore/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php. - changed the test to not rely on the locale module and the legacy source plugin, Variable.
Comment #15
quietone commentedgit grep -i 'migrate[_ ]drupal'is now returning what is expected so setting to needs review.Comment #16
andypostI bet it needs Change record and looks good to go
Comment #17
quietone commentedChange record created.
Currently at 853 files changed, 234 insertions(+), 192542 deletions(-)
Comment #18
andypostComment #19
quietone commentedComment #20
catchComment #21
smustgrave commentedTook the CR and added to the release notes.
For the help text should @Amber or @andypost be best to sign off?
Comment #22
mstrelan commentedI grepped for "migrate_drupal" and "Migrate Drupal" and everything remaining is related to marking this module as obsolete.
I then considered that multi-line doc blocks might have "Migrate Drupal" spread across two lines, with spaces and asterisks in between. I found one actual occurrence (MigrateSource) and one bogus occurrence (SystemRequirements) with this command:
If we've missed anything else here it might be worth getting this in as it is so it doesn't need to be rebased and so it's not holding up any other issues.
Comment #23
quietone commented@mstrelan, thanks.
I have removed the comment regarding 'Migrate Drupal' in core/modules/migrate/src/Attribute/MigrateSource.php.
The references in core/modules/system/src/Install/Requirements/SystemRequirements.php are correct. They are in lDRUPAL_CORE_REMOVED_MODULE_LIST.
Comment #25
amber himes matzI reviewed the changes to the file, core/modules/migrate/help_topics/migrate.overview.html.twig, and noticed that all but one of the items in the HTML definition list were removed. I updated the HTML wrapper for that sentence to a paragraph tag. Otherwise, looks good.
Comment #26
andypostI think it's ready to go now!
Comment #28
catchReviewed all the files with +s.
I noticed that the post update checks if migrate_drupal is installed, but we're already in migrate_drupal so it has to be installed to run. Doesn't really matter but two more lines of code that could be removed - can happen in a follow-up, but also that update itself will be removed in Drupal 13.
I think this is probably biggest negative diffstat for a single core issue ever, don't remember seeing anything quite like it.
Committed/pushed to main, thanks!