Technical helper module to copy file / image field data to an existing Drupal Core Media field in the same entity / entities.
Only for developers (using drush), test carefully and take backups before use!
Condition:
You have one or multiple entity type bundles with a regular file / image field
(non-media, e.g. from a migration), and you want to migrate its instances
data into a media field.
The media field already exists and is empty or has to be created before using
this module. It should never have any values yet.
You do not want to use heavy weight migration.
How to use:
- Add a media field, of the desired type, to the entity bundle you want to copy the file-data to.
- Create a backup.
- Install the module.
- Run
drush filefield-to-media:copy file-field-name media-reference-field-name media-bundle media-type-media-field-name entity-type [entity-bundle] [--no-reuse]
- `entity-bundle` is optional
- `--no-reuse` => This disables the reuse of existing media entities when available. Use this when you experience issues with the reuse hashes, you are not using the default media field configuration or when you need to use duplicates with different alt or title text.
drush filefield-to-media:copy field_image field_image_media image field_media_image nodeAlternative / similar modules:
- https://www.drupal.org/project/migrate_file_to_media
- https://www.drupal.org/project/file_to_media
- https://www.drupal.org/project/media_migration
- https://www.drupal.org/project/migrate_media_handler
- https://www.drupal.org/project/image_media_migrate/
Development proudly sponsored by German Drupal Friends & Companies:
webks: websolutions kept simple (https://www.webks.de)
and
DROWL: Drupalbasierte Lösungen aus Ostwestfalen-Lippe (OWL), Germany (https://www.drowl.de)
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Developer tools, Media
52 sites report using this module
- Created by anybody on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
Development version: 1.0.x-dev updated 18 Mar 2024 at 06:34 UTC



