Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293895

D7 Private file migrations use of source file_private_path variable creates wrong directory structure

$
0
0

I am migrating from a Drupal 7 site hosted on Pantheon to Drupal 8.8.4. I am using the migrate upgrade module and running the commands through drush.

The public files all imported correctly, including the files in subdirectories. But I can't get any of the private files to work. I can't tell if the issue is the private files or the subdirectories (all of the private files are in subdirectories so it's hard to isolate).

When I run drush migrate:import upgrade_d7_file_private and check the migrate messages I get errors such as Cannot read from non-readable stream (http://[hostname]/sites/default/files/private/subdirectory/file.pdf)

I see the MigratePrivateFileTest.php test passes, so I assume it's not just private files only that are the problem. The test sets the private directory at sites/default/private, but Pantheon requires it to be at sites/default/files/private. Maybe that is the problem?

I tried creating a test for that scenario (file_private_path set to sites/default/files/private, no further subdirectories) and it fails. But I also tried creating a test for public files in subdirectories (which works on my site migration) and that test fails too so something is not correct about my test.

I'm attaching a patch with those two tests. If anyone has advice on making the MigrateFileSubdirectoryTest.php pass (since I believe the functionality is working) then I can make a tests that shows my problem better.


Viewing all articles
Browse latest Browse all 293895

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>