Files migration issue

I am following this tutorial on how to migrate files from D7 into D8.

I have the migration setup with the following yml configuration:

uuid: a685a4e0-1022-4bf2-a787-f6f1bef587ea langcode: en status: true dependencies: {  } id: d8_files class: null field_plugin_method: null cck_plugin_method: null migration_tags:   - 'Drupal 7'   - Content migration_group: D7-TO-D8 label: 'D7 to 8 Public files' source:   plugin: d7_file   scheme: public   constants:     # source_base_path: 'sites/default/files/'     # source_base_path: '/var/www/d8/sites/default/files/'     # source_base_path: '/var/www/d8/sites/default/files/d7_download/page/files/'     # source_base_path: '/sites/default/files/d7_download/page/files/'     # source_base_path: '/var/www/d7/sites/default/files/page/files/'     source_base_path: '/var/www/d7/sites/default/files/' process:   fid: fid   filename: filename   source_full_path:     -       plugin: concat       delimiter: /       source:         - constants/source_base_path         - filepath     -       plugin: urlencode   uri:     plugin: file_copy     source:       - '@source_full_path'       - uri   filemime: filemime   status: status   created: timestamp   changed: timestamp   uid: uid destination:   plugin: 'entity:file' migration_dependencies: null 

Migrate-status indicates I have over 2000 files detected in the D7 database ready for migration but when I try migrating it just reports 0 migrated content and errors, shown below:

enter image description here

My guess is the migration does not know where to find the images but I have tried a variety of paths to those image by altering the source_base_path value however I still get no migrated files.

Can anyone help, please?

UPDATE:

I found out more on the issue preventing the migration.

When I checked the logs for the d8_files migration, I found messages such as the following:

File'/var/www/d8/sites/default/files/d7_download//sites/default/files/field/image/imagefield_OvRwVF.jpeg' does not exist 

The issue is how the module is creating the file url.

In the source section of my d8_file.yml, I had set the following:

source_base_path: '/var/www/d8/sites/default/files/d7_download/' 

… which is the absolute path to the directory containing the files I wish to migrate. The migrate module is concatenating /sites/default/files to the end of the path which makes it wrong. I have tried doing things like navigating up the directory path by using ../../ in the source_base_path settings but it doesn’t work … it’s just seen as a string.

Can anyone tell me how to correct this?

In the process section, I saw the following:

process:   fid: fid   filename: filename   source_full_path:     -       plugin: concat       delimiter: /       source:         - constants/source_base_path         - filepath 

I suspect that concat value is the problem. BUT, I have no idea what other value to set it to.

PS: Can anyone advice where is the system to find such information on any plugin ???

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Files migration issue

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.