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.
after fideling around im not able to import files.
i get always this error msg: "Could not create destination directory for public://my_img/test.gif/my_img/test.gif"
Comments
Comment #1
bst2002 CreditAttribution: bst2002 commentedadd to previous msg.: i use the migrate_d2d ui wizard which comes with the module migrate_d2d-7.x-2.x-dev. i'v also update to the latest migrate-dev version
Comment #2
mikeryanThis usually means a file permission issue in your Drupal files directory. Ah, but looking more closely, it seems like you've get a couple my_img/test.gif instances in your destination path. What did you specify as the source file directory in the wizard?
Comment #3
mikeryanComment #4
erindarri CreditAttribution: erindarri commentedI am also having trouble getting my images to be imported. It definitely sees the source directory, but not the destination.
Firstly, I want to confirm that with the wizard, there shouldn't be a need to create a class to register, right? Bringing files over should be able to be done with the wizard that comes with migrate_d2d-7.x-2.x-dev branch? I'm using the June 19 release along with the latest release of migrate 7.x-2.x-dev.
Now to my issue, here are the things I've tried for my destination sources. I am on a local machine, so I've sanitized some of the data below, hopefully it still makes sense. The owner and group for the bulk of the site is me/the local machine, with the exception of files, which is is www-data.
These are the things I've tried to enter for the default value for Subfield: Path within Drupal files directory to store file [destination_dir]. The file prefix in the Import form Drupal wizard is blank.
In the initial setup wizard where you walk through each entity type, I have used my local directory /git/[site]/sites/all/files, http://[site].[host]/default/files, and have tried just leaving it blank. I don't know if it matters that the source directory is http://[site]/files/[site.com]/files/product_images? It seems like it definitely is getting the source ok.
Thanks in advance for any help.
Comment #5
erindarri CreditAttribution: erindarri commentedI am still having the same issue as bst2002, so I'd like to re-open this support request and update my previous information.
I played with this some more today and made sure that the owner of the entire site was www-data with group web and had set permissions to 755 for sites/default/files. Still unable to copy files. I even opened up permissions to 777 for sites/default/files, and I still get 'could not copy file' error.
If you have any suggestions on next steps or things to double check, it would be much appreciated.
Thanks.
Comment #6
mikeryanBelatedly... I can't guess what the problem was here, I can only say that the destination_dir should be a Drupal stream wrapper - public://, public://legacy, something like that. The only thing I can suggest in these circumstances is verifying exactly what the sourcePath and destination being passed to copy() in MigrateFileUri::copyFile() are.
Comment #7
mikeryan