Files attached to nodes are imported with bad random names

Created on 22 August 2019, about 5 years ago
Updated 23 June 2023, over 1 year ago

Hello,
i need help with import nodes with attached files (images) from Drupal6 to Drupal8.
I've installed clean D8 site and copied D6 database to the same server as new D8 site:
D6 database is d6_temp and D8 is d8_temp.

On D8 i've installed and enabled latest versions of migrate, migrate_tools, migrate_plus, migrate_upgrade.
Then i run:
drush -l d8.domain.pl migrate-upgrade --legacy-db-url=mysql://u6_temp:u6_temp@localhost/d6_temp --legacy-root=https://www.domain.pl --configure-only

After that i run:
drush --debug -l d8.domain.pl migrate-import upgrade_d6_node_story_en

(which requires: upgrade_d6_filter_format, upgrade_d6_node_settings, upgrade_d6_node_type, upgrade_d6_user, upgrade_d6_user_role).

After that all nodes which type is story_en are imported fine except that all images attached to that nodes (in CCK field) are total messed up eg.:
[d8_temp]> select * from file_managed where fid='136370';
+--------+--------------------------------------+----------+------+---------------------------------------+------------------------------------------------+--------------------------+----------+--------+------------+------------+
| fid | uuid | langcode | uid | filename | uri | filemime | filesize | status | created | changed |
+--------+--------------------------------------+----------+------+---------------------------------------+------------------------------------------------+--------------------------+----------+--------+------------+------------+
| 136370 | 08f74c31-e39c-42e5-ab45-971f4be57dbe | pl | NULL | shivoprubiswakomospuuushitugijefruclu | public://shivoprubiswakomospuuushitugijefruclu | application/octet-stream | 0 | 1 | 1566483002 | 1566483002 |
+--------+--------------------------------------+----------+------+---------------------------------------+------------------------------------------------+--------------------------+----------+--------+------------+------------+

select * from node__field_fota_en where field_fota_en_description like 'Class of 2019 [01].jpg';
+----------+---------+-----------+-------------+----------+-------+-------------------------+-----------------------+----------------------------------------------------+
| bundle | deleted | entity_id | revision_id | langcode | delta | field_fota_en_target_id | field_fota_en_display | field_fota_en_description |
+----------+---------+-----------+-------------+----------+-------+-------------------------+-----------------------+----------------------------------------------------+
| story_en | 0 | 12687 | 12686 | und | 0 | 136370 | 0 | Class of 2019 [01].jpg |
+----------+---------+-----------+-------------+----------+-------+-------------------------+-----------------------+----------------------------------------------------+

entity_id is correct id of a node.

Why migration tools is changing all filenames to a random rubbish like "shivoprubiswakomospuuushitugijefruclu" and creates empty (zero size) file with that random name.

How to fix it so it would just copy filename from D6 to D8 without altering it?

I have to add that when i run:
drush --debug -l d8.domain.pl migrate-import upgrade_d6_file
All those files are correctly added (second time) to "file_managed" table but are not "connected" with correct node in table "node__field_fota_en".

💬 Support request
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

🇵🇱Poland lordzik

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024