Problem/Motivation
Followed instructions at How to test Drupal 6 to Drupal 8 migrations and began with user import.
I used devel generate to make users and ran it a few times, reinstalling between each run, to get used to the process. Then I added 1 picutre to one user and it failed.
$ sudo su www-data -c "drush migrate-manifest --legacy-db-url=mysql://x:x@127.0.0.1/d6 D6Manifest-User_0.yml"
Running d6_filter_format [ok]
Running d6_user_role [ok]
Running d6_user_picture_field [ok]
Running d6_user_picture_field_instance [ok]
Running d6_user_picture_entity_display [ok]
Running d6_user_picture_entity_form_display [ok]
Running d6_user_picture_file [ok]
copy(sites/default/files/pictures/picture-1165.png): failed to open stream: No such file or directory EntityFile.php:70 [warning]
File <em class="placeholder">sites/default/files/pictures/picture-1165.png</em> could not be copied to <em class="placeholder">public://pictures/picture-1165.png</em>. [error]
Running d6_user [ok]
Running d6_user_profile_field [ok]
Running d6_user_profile_field_instance [ok]
Running d6_user_profile_entity_display [ok]
Running d6_user_profile_entity_form_display [ok]
Running d6_profile_values:user [ok]And sites/default/files/pictures is writeable by all (777).
Proposed resolution
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 2369401-17.patch | 1.53 KB | quietone |
| #17 | 2369401-17-newtest.patch | 1.01 KB | quietone |
| #13 | 2369401-13.patch | 533 bytes | quietone |
Comments
Comment #1
quietone commentedUse correct parent issue
Comment #2
quietone commentedOn #drupal-migrate, weal explained that files are often a bit of an issue because drush doesn't have a parameter for the files location so it often fails. And then suggested using the migrate_upgrade module because it allows you to input a path in the ui at the upgrade. I've not tested that.
Comment #3
benjy commentedThere has been quite a few improvements around files. Could you try this again with the latest HEAD and Drush?
Comment #4
quietone commentedSure. There are new errors this time.
And www-data does have read access to the picture file.
$ sudo -u www-data ls -la /opt/md6/sites/default/files/pictures/picture-7.png
-rw-rw-r-- 1 www-data www-data 8456 Jan 18 14:39 /opt/md6/sites/default/files/pictures/picture-7.png
Comment #5
benjy commentedCan you post the manifest.yml file, looks like the source_base_path isn't configured.
This is a separate issue.
Comment #6
quietone commentedI used D6Manifest-User.yml at Manual testing (D6->D8): User and User Profile
Comment #7
benjy commentedYes, that is a little outdated now, you need something more like this for the file migrations.
Comment #8
quietone commentedThanks. But still no luck, adding in the change from #7, I get the following errors:
And, again with the original, outdated, manifest:
Comment #9
quietone commentedI've fixed some configuration problems stemming from my SSD crash and migrations are much improved.
I tried a migration with one user with a profile picture. The user is created but no picture. I found the picture in /tmp/mypix2.png and the following in file_managed.
Comment #10
benjy commentedCould be related to #2417975: EntityFile destination incorrectly assumes temporary files are absolute paths
Comment #11
quietone commentedApplied 2417975-1.patch and tried again. No files in D8 and none in /tmp. On the good side, the only errros are the "could not be copied to" for each file.
Comment #12
quietone commentedI had a typo in the manifest file so ignore #11.
Applied 2417975-1.patch and tried again. Profile pix successfully copied to public://pictures/picture-4.png but uid is still NULL.
Comment #13
quietone commentedRan again today, without 417975-1.patch and with the attached patch. It works, the picture is in the right destination and associated with the user. However, the destination directory, "sites/defaults/pictures", and contents, are chown "myuser:myuser" even though drush was run as user www-data.
But perhaps, this isn't needed if D6->D8 Upload Field Migrations not working is fixed.
Comment #14
ultimikeComment #15
quietone commentedOK ran again without the debugger and permissions are as expected.
drwxrwxr-x 2 www-data www-data 4096 Feb 12 17:53 picturesComment #16
ultimikeSetting this to "Needs review" to get the testbot involved, but we probably need to add a new test as well.
-mike
Comment #17
quietone commented2369401-17-newtest.patch has just the new tests and should fail and the other patch has the test and the fix.
Comment #19
ultimikeLooks good-to-go. Thanks!
-mike
Comment #20
alexpottMigrate is not frozen in beta. Committed 4e0c617 and pushed to 8.0.x. Thanks!