Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In Drupal 7, IP blocking was handled by the System module, which maintained the blocked_ips table in the database. In Drupal 8, this functionality has been split out into a core module called Ban, and it will need a migration path.
Proposed Resolution
Write a migration to save blocked IPs from Drupal 7 into Drupal 8.
Remaining Tasks
- Write the patch
- Write tests
- Review
- Merge into the parent issue
Comment | File | Size | Author |
---|---|---|---|
#31 | 2503049-31.patch | 6.45 KB | phenaproxima |
#31 | interdiff-2503049-19-31.txt | 2 KB | phenaproxima |
#19 | interdiff-2503049-17-19.txt | 524 bytes | phenaproxima |
#19 | 2503049-19.patch | 6.41 KB | phenaproxima |
| |||
#18 | interdiff-2503048-17-18.txt | 5.94 KB | phenaproxima |
Comments
Comment #1
phenaproximaThar be the patch. This is postponed on #2510072: UTF-8 support in MySQL driver breaks migrate dump files, since that issue is holding up the D7 upgrade path.
Comment #2
phenaproximaComment #4
phenaproximaFixed broken test.
Comment #5
quietone CreditAttribution: quietone commentedThanks to benjy for getting me started.
I checked that D7 uses a list of IP addresses and not say, a range. Applied patch and tests pass. I did find that the Source provider was 'aggregator', that is changed in the attached patch to 'system.
Comment #6
quietone CreditAttribution: quietone commentedChanged to RTBC as suggested on IRC by phenaproxima.
Comment #9
phenaproximaTestbot and its mood swings. Back to RTBC.
Comment #12
phenaproximaJust a l'il re-roll...
Comment #16
phenaproximaAh! Found the problem. It is a plugin dependency issue -- moving the migration template into the Ban module solves it, as per #2533886: [meta] Move module-specific migration support into the particular modules supported.
Comment #17
phenaproximaRe-rolled again, moving all the related plugins and tests into the Ban module's space, as per #2533886: [meta] Move module-specific migration support into the particular modules supported.
Comment #18
phenaproximaAs per discussion on IRC with @chx, removed an unneeded comment and migrated the iid column from {ban_ip}.EDIT: Whoops, overreached there. @chx and I decided not to migrate iid, and instead make it a known issue with the D6-D8 migration path.
Comment #19
phenaproximaRe-rolled from #17, this time just losing the extra comment.
Comment #20
chx CreditAttribution: chx commentedWe can't migrate iid because there's no API for it. (And ban is broken anyways because the findAll method is returning StatementInterface, boo.) The whole iid business should be dropped preferably before release if it is not too late (but perhaps it is).
Comment #22
webchickCommitted and pushed to 8.0.x. Thanks!
Comment #24
joelpittetHead seems to be broken on this patch it seems.
https://qa.drupal.org/8.0.x-status
Undefined property: Drupal\ban\Tests\d7\MigrateBlockedIPsTest::$collectMessagesDrupal\migrate\Tests\MigrateTestBase->display('New object was not saved, no error provided') Drupal\migrate\MigrateExecutable->import() Drupal\migrate\Tests\MigrateTestBase->executeMigration('d7_blocked_ips') Drupal\ban\Tests\d7\MigrateBlockedIPsTest->setUp() Drupal\simpletest\TestBase->run(Array) simpletest_script_run_one_test('38', 'Drupal\ban\Tests\d7\MigrateBlockedIPsTest')
Comment #25
webchickWell that's not good! Reverted. Must've conflicted with something else I committed tonight. ;(
Comment #27
neclimdul#2542318-5: Clean up local variables in MigrateTestBase in tearDown fixes this. sorry guys.
Comment #28
phenaproximaDoesn't need a re-roll; just needs the quick-fix #2542318-5: Clean up local variables in MigrateTestBase in tearDown committed. Postponing on that.
Comment #29
phenaproximaLet's run this past testbot once more before going back to the Jolly Land of RTBC.
Comment #31
phenaproximaRe-rolled anyway, moving the test into its proper namespace (for consistency with the Great Migration Migration).
Comment #32
mikeryanComment #33
webchickLet's try that again.
Committed and pushed to 8.0.x. Thanks!