When migrating d7_file, the source_base_path does not work in any case

Created on 22 September 2024, 3 months ago

- Migration of a Drupal 7 project to Drupal 10
- using the Migrate Drupal core module and other modules (Migrate Drupal UI, Migrate Plus, Migrate Upgrade, Migrate Devel)

The migration works for content, nodes, blocks and other entities.
The file migration does not work.

The error messages:

Missing file with ID
d7_file:uri:file_copy: File '/sites/default/files/.....' does not exist 

The problem:
The source_base_path is set, but is not working. The path is set in UI on /upgrade/credentials and the path is set in settings.php:
$settings['migrate_file_public_path'] = '/var/www/html/web-d7/sites/default/files';

And the path is correct.

I did a lot of tests. In any case the source_base_path is not used and not working.
Trying to migrate through Migrate Drupal UI or trying to migrate through drush command
drush migrate:import d7_file
In all cases the path does not work, although it is correct. The path is NOT used, die d7_file migration tries to copy the files from root folder /sites:
/sites/default/files/....
instead of base_bath + sites:
/var/www/html/web-d7/sites/default/files/...

Maybe it is possible to solve this with a workaround solution generating migration yml files. But this is not the solution we need.

What we need is a solution that solves the above problem without need of yml files.

Please help to write a patch for this problem. Maybe a core patch is needed, maybe it can be solved with a patch for the migrate_plus mode.

Thank you.

🐛 Bug report
Status

Active

Version

10.3

Component

migration system

Created by

🇦🇹Austria drupalfan2

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @drupalfan2
  • 🇳🇿New Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

  • 🇳🇿New Zealand quietone

    Now select the correct version

  • 🇳🇿New Zealand quietone

    I did notice that the path is set in both the UI and in settings.php. It only needs to be set in one place. And the patch should not include the public path as well. So, instead of '/var/www/html/web-d7/sites/default/files' it probably should be '/var/www/html/web-d7/sites/default/files'. Can you try that and report back?

    Since this functionality is tested I am changing to a support request, it can be changed back if a bug is found.

  • 🇫🇷France jibus

    I have the exact same problem. I don't understand how to transfer files. I tried several path without success

    So, instead of '/var/www/html/web-d7/sites/default/files' it probably should be '/var/www/html/web-d7/sites/default/files'.

    Shouldn't be /var/www/html/web-d7 ?

Production build 0.71.5 2024