Problem/Motivation

Currently {users}.data is not migrated.

Proposed resolution

Not a lot. The new UserData service stores semi structured data: it needs a $module and it needs a $key. Neither is easily attainable in an automated fashion.

We should write a contact settings migration and then contrib can use that as an example.

Remaining tasks

Write a UserData destination and a contact settings migration and test the whole shebang. Also, unserialize data in the user source.

The destination should have IDs $module, $uid, $name.

User interface changes

None.

API changes

We have a new destination. Rare!

Comments

chx’s picture

Version: 8.0-alpha11 » 8.x-dev
ultimike’s picture

moshe weitzman’s picture

Title: Write user data migration » Write users.data D6=>D8 migration
benjy’s picture

Assigned: Unassigned » benjy

Going to do this tomorrow.

benjy’s picture

I suggested that we simply add this functionality to the existing EntityUser destination so we're waiting on a response from someone who knows the Entity API as to why the user.data service is no longer injected into UserStorage.

https://www.drupal.org/node/597236#comment-9125225

chx’s picture

Issue summary: View changes
chx’s picture

Title: Write users.data D6=>D8 migration » Write per user contact settings D6=>D8 migration
benjy’s picture

Assigned: benjy » Unassigned
Issue tags: +Novice

This should be a pretty simple task adding the new migration. Going to tag it Novice and then maybe use it in core mentoring unless someone wants to pick it up.

berdir’s picture

You also need a source that extracts from users.data, which is a seriailzed column. That source will have to read the column, unserialize it and provide all top-level keys (anything else would be too complicated I think?) dynamically as fields so that the migration then can pick one and put it into the destination.

benjy’s picture

How about adding that to the existing user source?

chx’s picture

Issue summary: View changes

Agreed. Makes sense to use the users source.

benjy’s picture

Status: Active » Needs review
StatusFileSize
new7.07 KB

Patch attached.

  1. New destination for UserData
  2. New contact settings migration and test
  3. Updated the user source to query for data and unserialize it.
  4. Updated the user dump so we have a user with contact true, false and nothing at all.

Status: Needs review » Needs work

The last submitted patch, 12: 2268897-12.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new7.87 KB
new1.33 KB

Added schema for the D6 user source.

berdir’s picture

This looks good to me. There's still a TODO in the fields() method in the UserData destination but the implementation & migration looks fine to me. Nice work.

Someone who has worked a bit more with migrate (@chx?) should check this too, but RTBC from my side when that TODO is fixed.

benjy’s picture

StatusFileSize
new8.12 KB
new1.41 KB

Thanks for the reviews, i've added the fields implementation and updated the incorrect ids.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Looks great.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 17: 2268897-17.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.16 KB
new640 bytes

We need to skip the row when the setting doesn't exist.

Status: Needs review » Needs work

The last submitted patch, 20: 2268897-20.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new9.36 KB
new2.75 KB

Skip row if empty wasn't good enough because it's quite possible the setting could be "falsey" and therefore skipped. I've added a new process plugin, "skip_row_if_not_set" and fixed an error in the destination to return the three ids from import().

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC per #18. The last interdiffs look OK.

  • webchick committed 962e7bf on 8.0.x
    Issue #2268897 by benny, Berdir, chx: Write per user contact settings D6...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

benjy’s picture

Who's benny? ;)

webchick’s picture

Wtf? I totally don't remember manually editing that commit message. I'll fix it in a bit.

webchick’s picture

Oh shoot. You know what it probably is is Safari trying to be "helpful" and auto-correcting Dreditor's stuff. :( :(

benjy’s picture

No problem, i'm not sure how easy it would be to change so don't worry about that if it's a hassle.

Status: Fixed » Closed (fixed)

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