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.
Is this possible?
Can you provide us with some documentation about migrating D6 core profiles to D7 core user fields?
Comments
Comment #1
mikeryanIt should be straightforward - the D6 profile fields are presented as source fields, and any D7 fields on users will be presented as destination fields, so you should be able to map them directly. Are you using the UI for your migration, or programming it? Through the UI, you can edit the field mapping directly and choose what D6 profile field goes to what D7 user field. Programmatically, you would do something like:
Comment #2
anrikun CreditAttribution: anrikun commentedThanks for your answer @mikeryan, but where am I supposed to put this code? Inside what function?
I prefer to do it programmatically rather than using the UI.
Comment #3
heronog CreditAttribution: heronog commentedHere is some code that worked for me. You need to create a custom query for the profile fields.
I don't know if there is a better way to obtain this data from the source database, if there is I'd love to know.
Comment #4
anrikun CreditAttribution: anrikun commented@heronog: thanks for your code, I will try it and let you know!
Comment #5
anrikun CreditAttribution: anrikun commentedActually, as @mikeryan stated, the only thing necessary is to add field mappings. You don't have to add any custom query:
Thanks again to both of you!
Comment #6
mikeryan