This project is not covered by Drupal’s security advisory policy.

Video Embed Field provides an upgrade path from video_embed_field to oEmbed but this is only for Drupal installs which are using the Media source provided by video_embed_media. If your install has video_embed_field fields attached to entities, such as Nodes or Paragraphs, then the upgrade path is a little more complex and that's what this module aims to help with.

The upgrade path

In order to migrate away from video_embed_media to oEmbed provided by core the existing video_embed_media fields will need to be replaced with Entity Reference fields which reference a 'remote video' Media entity meaning that the video URL is then stored in a field attached to the Media entity rather than a Node\Paragraph\etc. This module provides a Drush command that will:

  1. Create a 'remote video' Media entity if it doesn't already exist
  2. Create Entity reference fields on the entities where there are currently video_embed_media fields
  3. Create a Media entity for each video_embed_media field value
  4. Create a reference to the new Media entity via the newly created reference field

Using this module

This guide assumes you have access to a local development environment and you are using git and config sync to deploy updates to your Drupal install.

Preparing the config changes

These steps should be carried out on your local development environment.

  1. Install via Composer and install\enable as you would do normally composer require drupal/video_embed_field_migrate
  2. Run drush vef_migrate field_new_reference_field where 'field_new_reference_field' is your desired machine name for the new media reference field
  3. The command will confirm the entities\fields which will be migrated, take a note of these. It will also confirm whether or not an existing remote video Media type exists or if one needs to be created. Providing you are happy, confirm the prompt to continue with the migration
  4. Once the migration is complete, there are likely some manual steps to be carried out:
    • Is the newly created reference field being printed in your template?
    • The command does not remove the legacy (video_embed_field) fields, once you're happy the migration was a success you will probably want to remove these
    • You may want to uninstall video_embed_field
    • You'll probably want to give some of your roles permission to CRUD the new Media entity type
  5. Once you've done your tinkering and you're happy, export your configuration changes and commit along with any other, templates etc., updates.

Deploying the migration

Once you've prepared the configuration changes you'll need to re-run the migration command on stage\production environment, ensuring you choose the same machine name for the reference field, and then import your new configuration\clear cache so any template changes take effect.

Supporting organizations: 

Project information

Releases