-1

I'm currently migrating a specific content type that has 16,000 nodes with different translations (english, french and spanish). After entering commands drush ms. It's only showing only half what is currently inside.

Group: Import from Drupal 7 (migrate_drupal_7)  Status  Total  Imported  Unprocessed 
upgrade_d7_node_press_release                   Idle    6042   0    

I tried importing those nodes for my curiosity and it only shows the english translations. Is there a way I can migrate all of those nodes with mixed translations.

enter image description here

Here is the YML configuration.

uuid: 9b022d2e-a1ab-40a4-ab72-4042222dc24b
langcode: en
status: true
dependencies: {  }
id: upgrade_d7_node_press_release
class: Drupal\migrate\Plugin\Migration
field_plugin_method: null
cck_plugin_method: null
migration_tags:
  - 'Drupal 7'
migration_group: migrate_drupal_7
label: 'Nodes (Press Release)'
source:
  plugin: d7_node
  node_type: press_release
process:
  nid: tnid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  comment_node_press_release/0/status: comment
  body:
    plugin: get
    source: body
  field_date_publish:
    plugin: sub_process
    source: field_date_publish
    process:
      value:
        plugin: format_date
        from_format: 'Y-m-d H:i:s'
        to_format: 'Y-m-d\TH:i:s'
        source: value
  field_image:
    plugin: sub_process
    source: field_image
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_region_country:
    plugin: sub_process
    source: field_region_country
    process:
      target_id: tid
  field_themes:
    plugin: sub_process
    source: field_themes
    process:
      target_id: tid
  field_pbn_additional_items:
    plugin: get
    source: field_pbn_additional_items
  field_pbn_file:
    plugin: sub_process
    source: field_pbn_file
    process:
      target_id: fid
      display: display
      description: description
  field_pbn_analysis:
    plugin: get
    source: field_pbn_analysis
  field_tags:
    plugin: sub_process
    source: field_tags
    process:
      target_id: tid
  field_default:
    plugin: sub_process
    source: field_default
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_multimedia: field_multimedia
  field_press_release_type:
    plugin: sub_process
    source: field_press_release_type
    process:
      target_id: tid
destination:
  plugin: 'entity:node'
  default_bundle: press_release
migration_dependencies:
  required:
    - upgrade_d7_user
    - upgrade_d7_node_type
  optional:
    - upgrade_d7_field_instance
    - upgrade_d7_comment_field_instance
1

You have to create a YML configuration file for each language and add as migration_dependencies the original language YML configuration file wich is english in your case "upgrade_d7_node_press_release":

migration_dependencies:
  required:
    - upgrade_d7_node_press_release
  • 1
    create 2 other yml files : upgrade_d7_node_press_release_spanish & upgrade_d7_node_press_release_french and copy paste the code of the upgrade_d7_node_press_release yml file then you add the code of migration dependencie that i wrote in the answer, clear caches, and try again with drush ms – Mohammed ATIFI Jan 16 '18 at 14:58
  • 1
    it's also a requirement, you have to change it – Mohammed ATIFI Jan 17 '18 at 7:28
  • 1
    you need migrate_plus and migrate_tools – Mohammed ATIFI Jan 19 '18 at 9:21
  • 1
    those are the only modules you need to migrate content – Mohammed ATIFI Jan 19 '18 at 9:28
  • 1
    this doc may help you, it contains a Multilingual migrations part : google.com/… – Mohammed ATIFI Jan 19 '18 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.