drupalorg_migrate-1.0.x-dev/migrations/drupalorg_migrate_documentation.yml

migrations/drupalorg_migrate_documentation.yml
id: drupalorg_migrate_documentation
label: 'Drupal.org documentation'
migration_group: drupalorg_migrate
# Commenting out the below will require the d7_file migration.
#migration_tags:
#  - Drupal 7
#  - Content

#deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
source:
  plugin: d7_node
  batch_size: 1000
  track_changes: true
  node_type: documentation

destination:
  plugin: entity:node

process:
  nid: tnid
  temp:
    plugin: skip_on_empty
    method: row
    source: title
    message: "Node has no title."
  type:
    plugin: default_value
    default_value: documentation
  langcode:
    plugin: default_value
    source: language
    default_value: "und"
  title: title
  uid:
    plugin: migration_lookup
    migration: drupalorg_migrate_users
    source: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky

  field_tags:
    plugin: sub_process
    source: tags
    process:
      target_id:
        plugin: migration_lookup
        migration: drupalorg_migrate_tags
        source: tid
  body: body
  field_related_content:
    plugin: sub_process
    source: field_related_content
    process:
      target_id:
        plugin: migration_lookup
        migration:
          - drupalorg_migrate_post
          - drupalorg_migrate_documentation
          - drupalorg_migrate_guide
          - drupalorg_migrate_changenotice
          - drupalorg_migrate_page
        source: target_id
        no_stub: true
  upload:
    plugin: sub_process
    source: upload
    process:
      target_id:
        plugin: migration_lookup
        migration:
          - drupalorg_migrate_documentation_media_images
          - drupalorg_migrate_documentation_media_documents
        source: fid
  field_summary: field_summary
  og_group_ref_documentation/target_id:
    plugin: og_entity_ref
    source: '@nid'
    og_source_field: og_group_ref_documentation
  field_documentation_status: field_documentation_status
  field_asciidoc_source_file: field_asciidoc_source_file
# @todo Test this as the field is new. Is there any field on D7 that might be equivalent?
#  field_weight:
#    plugin: default_value
#    default_value: 0

migration_dependencies:
  optional:
    - drupalorg_migrate_users
    - drupalorg_migrate_documentation_media_images
    - drupalorg_migrate_documentation_media_documents
    - drupalorg_migrate_tags
    - drupalorg_migrate_post
    - drupalorg_migrate_guide
    - drupalorg_migrate_changenotice
    - drupalorg_migrate_page

dependencies:
  enforced:
    module:
      - drupalorg_migrate

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc