I have a Drupal 6 site with 7 user profile fields grouped into 2 categories. I have 874 users on the site, all with data in the 7 profile fields. When I migrate the site (using drush migrate-import --all) I do not get any errors related to user. All the 874 users are migrated to the Drupal 8 site. All 7 user profile fields are created (but not grouped into categories - that's fine), however no values are populated into the user profile fields. I expect all the values from Drupal 6 user profile fields to be populated into the newly created Drupal 8 user fields.
Output from mysql:
mysql> select * from user__profile_country;
Empty set (0.09 sec)
mysql> select * from user__profile_firstname;
Empty set (0.10 sec)
mysql> select * from user__profile_surname;
Empty set (0.10 sec)
mysql> select * from user__profile_birthyear;
Empty set (0.10 sec)
The tables: users, users_data and users_field_data are populated.
Comment | File | Size | Author |
---|---|---|---|
#28 | 2823414-28.patch | 1.23 KB | twardnw |
#23 | migrate_plus.migration.upgrade_user_profile_field.yml | 984 bytes | anairamzap |
#23 | migrate_plus.migration.upgrade_user_profile_field_instance.yml | 718 bytes | anairamzap |
#23 | migrate_plus.migration.upgrade_d6_profile_values.yml | 610 bytes | anairamzap |
#13 | 2823414-13.patch | 1.24 KB | albertski |
Comments
Comment #2
Matt BComment #3
Matt BThis is the migrate_plus.migration.upgrade_d6_user.yml file, generated by the migrate process. I notice none of the profile fields are referenced, should they be?
Comment #4
mikeryanProfile field values are migrated in d6_profile_values, not in d6_user - what does upgrade_d6_profile_values.yml look like?
Comment #5
Matt BHi Mike, see below:
I'm using migrate_upgrade 8.x-3.0-rc1 migrate_plus 8.x-3.0-beta1 and migrate_tools 8.x-3.0-beta1.
Comment #6
Matt BComment #7
mikeryanDid the profile values migration generate any errors?
Comment #8
Matt BNo messages for this migration [status]
Comment #9
Matt BJust upgraded to Drupal 8.2.2 and tested again - confirmed this is still an issue.
Comment #10
albertski CreditAttribution: albertski at Xeno Media, Inc. commentedI have the same issue with profile values not migrating over. When I run command:
drush mmsg upgrade_d6_profile_values
I get:drush mmsg upgrade_d6_profile_values
[status] No messages for this migration
Comment #11
albertski CreditAttribution: albertski at Xeno Media, Inc. commentedI am trying to debug this and not sure if this is the issue but in EntityContentBase::updateEntity() it does a foreach of $row->getDestination(). Problem is that $row->destination only contains uid. array('uid' => xx). I'm guessing that destination should have all the fields. (Example first_name, last_name, etc..)
Comment #12
albertski CreditAttribution: albertski at Xeno Media, Inc. commentedI was able to get this to work properly by setting the destination property of all fields.
Comment #13
albertski CreditAttribution: albertski at Xeno Media, Inc. commentedComment #14
mikeryanComment #15
mikeryanI tested locally, running migration from a D6 site with a few profile fields to D8. Doing a straight migrate-upgrade, it worked - the values were properly migrated. However, doing migrate-upgrade --configure-only followed by migrate-import --all, the values did not get migrated. So, it seems like the --configure-only is missing something in setting up the migration configuration entities that breaks the profile value migration.
Comment #16
drzraf CreditAttribution: drzraf commentedThis comment enlightened me.
Indeed I encounter different kind of bugs between
*
migrate-upgrade --configure-only
+migrate-import --all
and
*
migrate-upgrade
aloneI'm also under the impression that calls to
drush ms
anddrush cc drush
can affect the way a migration takes place.Comment #17
mikeryanYes, one distinct possibility is the problem is with the dual-plugin-manager situation being addressed in #2795447: Use the core plugin manager/#2830036: MigrationPluginManager::getDefinitions() blows up in node derivers/#2752335: Properly integrate configuration-entity-based migrations with the core plugin manager. The next thing to do (I probably won't have time today) would be to test with all those patches.
Comment #18
drzraf CreditAttribution: drzraf commentedI'd rather not want to pollute this specific issue, but just to add to this:
migrate-manifest
migrate-upgrade --configure-only
+migrate-import --all
migrate-upgrade
UI
behave differently.
I found that
migrate-manifest
andUI
often give best results.--configure-only
creates strange issues (I personally experience such issues with{d6_term_node}
and{d6_field_instance_widget_settings}
)On the contrary, UI cause trouble with the
{d6_file}
migration (NULL destid1)Diff'ing DB dump of the
migrate_map*
tables from two instances migrated using distinct methods makes the issue clear: destid* columns are NULL when using migrate-upgrade.Comment #19
mikeryanPer my theory in #17 - can anyone reproduce this problem with the migrate_plus and migrate_tools 8.x-4.0-beta1 releases?
Comment #20
Matt BI have now retested using Drupal 8.3.2, migrate upgrade 8.x-3.0-rc1, migrate_plus 8.x-4.0-beta1 and migrate_tools 8.x-4.0-beta1, and I am still not getting the profile fields populated. They are created, but contain no data.
No messages from 'drush mmsg upgrade_d6_profile_values'
Comment #21
heddnLooks like we have one report of this not working, are there any other reports of this working or not with the latest versions of things?
Comment #22
heddnCleaning up the issue queue. If we can reproduce this with the latest code, then please re-open with complete steps on how to reproduce this issue.
Comment #23
anairamzapHi, I'm trying to migrate profile values from D6 to D8 and I'm finding some problems to migrate a picture field.
In D6 I have two profile "fields":
When I run
drush mi upgrade_d6_profile_values -execute-dependencies
The textfield field, correctly imports into D8 (it creates the field instance and imports the value), but for the picture field I get:
Attempt to create a field field_profile_image that does not exist on entity type user.
If I manually create the field in D8, I no longer get the error, but the values are not imported.
I'm not sure if this is something to do with missing dependencies or if its related to the field type.
In the upgrade_user_profile_field.yml file generated by
drush profile-upgrade --configure-only
I seeThat is, the only missing type map is picture type (not sure if this is the expected). Shouldn't be a map "image: picture" in that process section?
Attaching here the relevant yml files.
Let me know if this should be a new issue and I will create it, but I thought it was related to the original post.
Cheers!
m
Comment #24
Olarin CreditAttribution: Olarin at Kosada commentedI encountered this issue (no profile field values getting saved) while working on https://www.drupal.org/project/drupal/issues/2797047, and have included there a modified version of the fix in #13. (using migrate-upgrade --configure-only and then piecemeal migrate-import)
Comment #25
cestmoi CreditAttribution: cestmoi commentedI have the latest versions as below and I am having the same issue of the original post here. Profile fields are created but no values are migrated. Migration still shows that all values were migrated ! drush mmsg shows nothing.
All codes are up to date:
Drupal version : 8.5.5
migrate_manifest : 8.x-1.7
migrate_plus : 8.x-4.0-dev
migrate_tools: 8.x-4.x-dev
migrate_upgrade: 8.x-3.x-dev
I first did the
migrate-upgrade --configure-only
then usedmigrate-import
for users . I had to add "no_stub: true
" to roles in theupgrade_d6_user
config yml to make the users migration work. Otherwise it would stop at 12 users no matter what. I have over 6000 users. Roles were not migrated. All roles ignored (I have just the Adminstrator and an "Editor" roles).No roles were migrated still.
I did rollback
I created a "Editor" role manually and added it to two users. I also added the Administrator role to my account.
1. In admin/config/people/accounts/fields
- I could see the profile values fields there but duplicated
- I deleted the extra ones (e.g. profile_gender1, profile_country1 ...etc )
2. On fields Manage Form Display : admin/config/people/accounts/form-display
- The above fields were disabled.
- I enabled them.
3. in Manage Display : admin/config/people/accounts/display
- They're all disabled too.
- I enabled them.
I tried the migration again and got same results:
drush migrate-import upgrade_d6_profile_values
all done .
drush ms upgrade_d6_profile_values
No values were migrated still !
This is my config yml :
This migration experience has been very frustrating and full of issues and I'm glad now the only issue left is this profile_values one and all the rest was done well.
EDIT: I tried to apply @albertski patch (at #13) but it failed to patch (in command line) to my D5.5.5 . I feel it would work for me if the patch was applied.
UPDATE: I applied the above patch manually and did migration rollback on profile_values and repeated the migration and it's working and importing while writing this update as I can see the DB tables updated with users data.
Comment #26
heddnThere's a test over in #3023504: Add test coverage for drush config export. The reason why this seems to be happening is that we are trying to generate a config entity in core inside of the profile field migration and that is failing:
Comment #27
TheBurt22 CreditAttribution: TheBurt22 commentedThe same issue still persists. I am using
drupal/core 9.1.6
Manually applying the patch from #13 fixes it just fine. Are there plans to apply it to core?
Comment #28
twardnw CreditAttribution: twardnw as a volunteer commentedJust ran into this issue as well, I wasn't able to automatically apply the patch in #13 using composer, so I re-rolled against 9.3.16
Comment #29
AnybodyLooking at the patch in #13 I'm asking myself if anyone with deeper Migrate knowledge can tell from the code, if setting the destination plugin is clearly missing. If that's the case, things are quite clear here.
Then we should reroll the patch and get it in.