Allow file source plugint to filter by mime type

Created on 9 February 2022, almost 3 years ago
Updated 16 February 2023, almost 2 years ago

Problem/Motivation

When d7_file migration is reused, in the source section it is not possible to filter the type of file to migrate.

Steps to reproduce

Reuse d7_file migration, it is not possible to filter by type.

Proposed resolution

Add code to Drupal\file\Plugin\migrate\source\d7 File.php

In the first comment I post a patch that I have been using for some time.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Closed: duplicate

Version

10.1

Component
Migration 

Last updated 3 days ago

Created by

🇮🇹Italy arturopanetta Grotteria (RC)

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.

  • 🇺🇸United States mikelutz Michigan, USA

    The core migration sources are designed to support the core migration UI, which itself is designed to migrate all content/users from a d7 site. There is no need to limit files by mimetype, as they are all migrated at once in the core file migrations. You will want to have a custom source plugin to support your custom migration here, but it is not appropriate to include custom migration sources in Drupal core. The migration system is designed to be extensible to allow you to create targeted source plugins like this as needed.

  • Status changed to Closed: duplicate almost 2 years ago
  • 🇺🇸United States mikelutz Michigan, USA

    Note: we do have an issue #3069776: SQL source plugins: allow defining conditions and join in migration yml to allow arbitrary sql filtering on ANY plugin extending SqlBase. This is something that we would make use of in core to reduce the number of source plugins needed. It would also be a path to solving your issue. In retrospect, I'm going to close this as a duplicate of that one.

Production build 0.71.5 2024