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

  1. ✅ 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: obsolete so new sites don't install it. Add a hook_update_N() to uninstall the module.
  2. ✅ Remove references from core/phpstan-baseline.neon.
  3. ✅ Spelling words have not been removed. This is better done in a dictionary rebuild before 12.0 beta, I guess.
  4. ✅ Removed exclusion of migrate drumps from cspell.,json
  5. ✅ Add the extension to the relevant removed list, either DRUPAL_CORE_REMOVED_MODULE_LIST or DRUPAL_CORE_REMOVED_THEME_LIST, in system.install.
  6. 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

Command icon 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:

Comments

quietone created an issue. See original summary.

quietone’s picture

It look like there are two tests still integrated with Migrate Drupal.

   Class                                 
         Drupal\migrate_source_annotation_bc_test\Plugin\migrate\source\Migrat  
         eSourceWithAnnotationsMultipleProviders extends unknown class          
         Drupal\migrate_drupal\Plugin\migrate\source\EmptySource.          
Class Drupal\Tests\migrate\Kernel\MigrateEntityContentBaseTest uses    
         unknown trait Drupal\migrate_drupal\Tests\StubTestTrait.    
catch’s picture

Status: Postponed » Needs work

I don't think I've ever seen a core diffstat as dramatic as

+ 281
− 166577

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.

gábor hojtsy’s picture

Issue summary: View changes

Elaborated in issue summary on what "keeping it in core" means in this context. Keeping uninstall code and the info file basically.

catch’s picture

Issue summary: View changes
catch’s picture

Re: #3.

   Class                                 
         Drupal\migrate_source_annotation_bc_test\Plugin\migrate\source\Migrat  
         eSourceWithAnnotationsMultipleProviders extends unknown class          
         Drupal\migrate_drupal\Plugin\migrate\source\EmptySource. 

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).

Class Drupal\Tests\migrate\Kernel\MigrateEntityContentBaseTest uses    
         unknown trait Drupal\migrate_drupal\Tests\StubTestTrait.    

This looks like it could be copied to migrate module and used from there.

catch’s picture

quietone’s picture

Issue tags: +12.0.0 release notes
quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed
catch’s picture

Status: Postponed » Needs work
quietone’s picture

Assigned: quietone » Unassigned
Issue summary: View changes
quietone’s picture

Issue summary: View changes

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.

I am checking the others now.

quietone’s picture

Issue summary: View changes

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.

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review

git grep -i 'migrate[_ ]drupal' is now returning what is expected so setting to needs review.

andypost’s picture

Status: Needs review » Needs work

I bet it needs Change record and looks good to go

quietone’s picture

Status: Needs work » Needs review

Change record created.

Currently at 853 files changed, 234 insertions(+), 192542 deletions(-)

andypost’s picture

Issue tags: -Needs change record
quietone’s picture

Issue summary: View changes
catch’s picture

Issue tags: +Avoid commit conflicts
smustgrave’s picture

Issue summary: View changes
Issue tags: -Needs release note

Took the CR and added to the release notes.

For the help text should @Amber or @andypost be best to sign off?

mstrelan’s picture

Status: Needs review » Needs work

I 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:

$ grep -Przl 'Migrate\s+\*?\s*Drupal' core --exclude-dir='migrate_drupal*'
core/modules/system/src/Install/Requirements/SystemRequirements.php
core/modules/migrate/src/Attribute/MigrateSource.php

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.

quietone’s picture

Status: Needs work » Needs review

@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.

amber himes matz made their first commit to this issue’s fork.

amber himes matz’s picture

I 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.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

I think it's ready to go now!

  • catch committed 7709975b on main
    task: #3572280 Remove Migrate Drupal
    
    By: quietone
    By: catch
    By: gábor...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Reviewed 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!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.