Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Major
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
26 Jan 2015 at 21:55 UTC
Updated:
10 Sep 2015 at 21:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
miguelc303 commentedI did a patch to enable end user to migrate Users Accounts from drupal 7 to drupal 8.
Comment #2
andypostUser signatures could go contrib for d8
Comment #3
benjy commentedComment #4
benjy commentedComment #5
miguelc303 commentedAdded organization support to Anexus IT
Comment #6
phenaproximaUpdated against HEAD and postponed until MigrateDrupal7TestBase lands.
Comment #7
phenaproximaComment #8
phenaproximaComment #9
phenaproximaComment #10
phenaproximaMerged #2132221: Variable to config: user.flood [d7] and #2402201: Migration Files for Drupal 7 Roles and Permissions.
Comment #11
benjy commentedThere is talk of changing the migrate/user/password stuff over here: https://www.drupal.org/node/1845004#comment-9997759
Might be worth checking out how that will work with this patch.
Comment #12
phenaproximaUpdated the patch, and tests. Removed a bunch of stuff relating to mapping filter format permissions to roles; I don't think this will be necessary, because filter formats don't need to be migrated before roles. (Roles will happily save, even if they contain undefined permissions.)
Comment #14
phenaproximaCleaned up MigrateUserTest and a couple of other things.
Comment #15
phenaproximaMerged #2414599: Migration Files for Drupal 7 User Picture Field.
Comment #16
phenaproximaFixing minor test breaks caused by the removal of the fake DB driver.
I've omitted the interdiff because the patch in #15 accidentally included a bunch of stuff from 8.0.x that has nothing to do with user migration. Whoops :)
Comment #17
phenaproximaRe-rolled because the patch was seriously out of date. Changes were fairly extensive so I'm skipping the interdiff.
Comment #18
mikeryanPostponed on #2534042: Move module-specific migration support into the user module - let's get everything moved first (which will require rerolling this patch).
Comment #20
phenaproximaComment #21
phenaproximaComment #24
phenaproximaAnd now for something completely similar (re-roll).
Comment #28
phenaproximaLet's see how this one does. I consolidated a few migrations which were identical for D6 and D7, so there's a good chance this will fail testing.
Comment #30
quietone commentedMoved test files from Migrate/d6 to Migrate.
Comment #32
quietone commentedThere were still some calls to loadDumps and references to d6_user_picture...
Let's try again.
Comment #34
quietone commentedExcept for MigrateDrupal6Test, these tests pass locally. This is isn't the first time I've had problems because of the MigrateDrupal6Test. What is the value of MigrateDrupal6Test?
Comment #35
phenaproximaShould be fixed now. It was one damn line in d6_user.yml...and one of the more emotionally exhausting bugfixes of my career thus far.
EDIT: Uh...hmm, I screwed up that upload. The ~55KB one is correct.
Comment #38
quietone commentedthx phenaproxima, I looked right at that file a couple of times and missed it. 'Emotionally exhausting' is right!
Comment #40
phenaproximaComment #41
mikeryanBefore doing a full code review, I've tried running this with a real D7 site using migrate_upgrade. Issues I've found:
Comment #42
mikeryanI'm taking a pass at this atm.
Comment #43
mikeryanOK, on the user role issue, applying the user_update_8002 process plugin as we did for D6 maps the anonymous and authenticated roles appropriately. We still get Administrator plus administrator, but that's not a built-in role - it's arguable either way whether it should be automatically consolidated or not - if it should, that would be a separate issue.
With the user role issue fixed, I next hit "Fatal error: Call to a member function getFileUri() on a non-object in /Users/mryan/Sites/IMP2/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php on line 318" (with some tweaking to the user_picture migration). Commenting out the picture migration for now led to successful user import, so we've still got some work to do on the pictures.
Comment #44
phenaproximaThis is blocked by #2555089: d7_filter_format migration mishandles format IDs.
Comment #45
phenaproximaThis is also the first of the "Big Four" migrations for D7, so it is absolutely Migrate-critical, and it blocks the Node migration since nodes need an author :)
Comment #46
phenaproximaHere it is, folks...the working (I hope) patch for user migration, pulled from the IMP2 sandbox.
Comment #47
phenaproximaUnblorked.
Comment #48
phenaproximaFixed assorted sucktitude and WTFs.
Comment #51
benjy commentedShared migrations, that's cool.
Comment #53
phenaproximaThar be cruft in them thar tests. Let's try again.
Comment #55
phenaproximaGeneralized the user_mail migration -- it's identical between D6 and D7 -- and added assertions for it.
Comment #56
phenaproximaFixed failures resulting from #55.
Comment #60
phenaproximaGood lord. Once again?
Comment #63
quietone commentedAnd again. :-)
Comment #65
quietone commentedOops, got a knock on the door and didn't check test results before submitting the previous patch.
Since D6 user_mail tokens do not get converted was committed the user mail migration includes all the user_mail_* variables, which by the way, are different than the ones in D7 and that is why #60 fails. D7 has the same user_mail variables as D6 plus one more, user_mail_cancel_*. There is a nifty page showing the differences but I can't find it tonight.
The attached patch separates the user_mail migrations, so that the D8 mail cancel_confirm fields are filled by the D6 user_mail_delete variables (as in #2551631) and for D7 they are filled with the user_mail_cancel variables (as in patch #60).
No interdiff, as it fails.
Comment #67
phenaproximaFixing the failure. Interdiff is being weird for me too, so screw it.
Comment #68
mikeryanHere are the diffs between D6 and D7 files that exist for both, always enlightening.
Meanwhile, ran both a D6 and D7 site through migrate_upgrade with this patch, users look fine in both.
Comment #69
mikeryanJust reviewing the diffs between D6 and D7, haven't done a full patch review yet:
Since the D7 users.picture was a fid, and we're preserving IDs (including fids), shouldn't we able to do
here?
Just to clarify in my mind - tokens changed between D6 and D7, but not between D7 and D8, thus we don't need the conversion here?
Comment #70
phenaproximaAdded profile support by generalizing the d6_profile_* migrations (except d6_profile_field_values). The d7_user migration uses a builder to merge profile properties directly into the user object.
Comment #72
phenaproximaWhoops.
Comment #73
quietone commentedRe #2 in comment #69.
From working on "D6 user_mail tokens do not get converted" I do believe that the '!' style tokens are only in D6.
Comment #75
phenaproximaWat.
Comment #76
mikeryanDown to the nits...
I still feel the one-line
is worth adding here rather than doing in a followup.
The try only needs to be around the checkRequirements() call.
The rest looks good to me, and manual tests continue to succesfully import users...
Comment #77
phenaproximaComment #78
mikeryanThe getSourcePlugin could be move out of the try, but don't bother unless you're rerolling anyway...
RTBC by my account!
Comment #79
webchickThis looks like it'll come in handy for other entity migraitons. yay.
A huge chunk of the patch is just doing changes like this; that's awesome that we're able to re-use all of this stuff from the D6 migration. :D
Not introduced in this patch, but WTF at that class name? :P
Committed and pushed to 8.0.x. YEAH! 1 down, 3 to go. :)
Comment #81
webchickOh, neglected to mention my favourite part which is the new email texts. ;)