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

bst2002’s picture

add 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

mikeryan’s picture

Title: What i'm doing wrong » Could not create destination directory
Status: Active » Postponed (maintainer needs more info)

This 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?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
erindarri’s picture

I 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.

Setting Error Response Notes
public:// The specified file sites/[site].[host].com/files/product_photos/[file].jpg could not be copied to public://[file].jpg. Incidentally, one file out of 20 didn't fail, but I am not sure which one it is. I get the same number of errors if all 20 fail or if any succeed.
http://[site].[host]/sites/default/files Error Could not create destination directory for http://[site].[host]/sites/default/files/[file].jpg all 20 failed, sites/default/files belongs to www-data
blank Could not create destination directory for /[file].jpg well, duh. Dunno what I expected; all 20 failed.

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.

erindarri’s picture

Status: Closed (cannot reproduce) » Active

I 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.

mikeryan’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Belatedly... 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.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)