Process plugin: substr

The substr plugin is used to return part of a string.

process:
  new_text_field
    plugin: substr
    source: some_text_field
      start: 2
      length: 7

If some_text_field was 'Marie Skłodowska Curie' then $destination['new_text_field'] would be Skłodowska.

The PHP equivalent of this would be:

$destination['new_text_field'] = substr($source['soume_text_field'], 6, 10)

Process plugin: route

The route process plugin sets the destination route information based on the source link_path.

Process plugin: menu_link_parent

The menu_link_parent source plugin figures out menu link parent plugin IDs.

Example:

process:
  parent:
    plugin: menu_link_parent
    source:
      - plid
      - menu_name
      - parent_link_path

The source expects three values:

Writing a process plugin

You can implement the MigrateProcessInterface interface or extend from the abstract class ProcessPluginBase. Apply the MigrateProcessPlugin plugin annotation.

Migrate Drupal UI: migrate from earlier Drupal versions

The core Migrate Drupal UI module was added in Drupal 8.1.0 to provide a user interface on top of the Migrate Drupal module. The interface allows users to migrate from an earlier version of Drupal (6 or 7) to Drupal 8. See https://www.drupal.org/upgrade/migrate

Process plugin: explode

The explode plugin creates an array of strings, each of which is a substring formed by splitting the source on boundaries formed by the string delimiter.

One use case is for building the theme and color configuration setting name from the Drupal 7 variable name. For example, to convert theme_bartik_settings to bartik.settings.

Pages

Subscribe with RSS Subscribe to RSS - migrate