url aliases of translated nodes are pointing to old node id after migration to d8

Created on 1 September 2017, over 7 years ago
Updated 26 January 2024, 11 months ago

Hi,

I am working on migration of a multilingual site. I did the following steps --

I generated the yml files using migrate_upgrade command and export the yml files related to my content type.

e.g.
migrate_plus.migration.upgrade_d7_node_article.yml
migrate_plus.migration.upgrade_d7_node_translation_article.yml

Now when I am executing the above files using :

drush mi d7_url_alias
drush mi my_d7_node_blog
drush mi my_d7_node_translation_blog

Issue I found is the url aliases are not migrating for translations.
When I check in the list of url-aliases on D8 site, it is present there but with existing node id (of D7) for translation.
But when I edit the translation node in D8, it is not there.

id: my_d7_node_article
class: Drupal\migrate\Plugin\Migration
field_plugin_method: null
cck_plugin_method: null
migration_tags:
  - 'Drupal 7'
migration_group: migrate_final
label: 'Nodes (Article)'
source:
  plugin: d7_node
  node_type: article
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
  field_legacy_nid: tnid
  field_taxo_industries:
    plugin: iterator
    source: taxonomy_vocabulary_2
    process:
      target_id: tid
  field_abstract:
    plugin: iterator
    source: field_abstract
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_number_of_pages: field_number_of_pages
  field_content_contributor:
    plugin: iterator
    source: field_content_contributor
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_article_type: field_article_type
  field_pdf:
    plugin: iterator
    source: field_pdf_article
    process:
      target_id: fid
      display: display
      description: description
  field_read_view_article: field_read_view_article
  field_link:
    plugin: d6_field_link
    source: field_external_link
  field_taxo_solutions:
    plugin: iterator
    source: field_taxonomy_solutions
    process:
      target_id: tid
  field_taxo_topics:
    plugin: iterator
    source: field_vocabulary_trends
    process:
      target_id: tid
  body:
    plugin: iterator
    source: body
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_related_media_image:
    plugin: iterator
    source: field_image_horizontal
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_pdf_thumbnail:
    plugin: iterator
    source: field_image_vertical
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_featured_content:
    plugin: iterator
    source: field_featured_content
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_taxo_services:
    plugin: iterator
    source: taxonomy_vocabulary_3
    process:
      target_id: tid
  field_to_be_deleted: field_to_be_deleted
  field_taxo_about_us:
    plugin: iterator
    source: field_taxonomy_about_us
    process:
      target_id: tid
  field_taxo_careers:
    plugin: iterator
    source: field_taxonomy_careers
    process:
      target_id: tid
  field_expert_display: field_display_expert
  field_expert_taxo_industries:
    plugin: iterator
    source: field_experts_tagged_under_indus
    process:
      target_id: tid
  field_expert_taxo_services:
    plugin: iterator
    source: field_experts_tagged_under_servi
    process:
      target_id: tid
  field_expert_taxo_solutions:
    plugin: iterator
    source: field_experts_tagged_under_solut
    process:
      target_id: tid
  field_expert_taxo_topics:
    plugin: iterator
    source: field_experts_tagged_under_trend
    process:
      target_id: tid
  field_invisible_counter: field_invisible_counter
  field_social_share: field_social_share
  field_meta_tags: field_meta_tags
destination:
  plugin: 'entity:node'
  default_bundle: my_article
migration_dependencies:
  required: {  }
  optional: {  }

The YML file for translation is --

id: my_d7_node_translation_article
class: Drupal\migrate\Plugin\Migration
field_plugin_method: null
cck_plugin_method: null
migration_tags:
  - 'Drupal 7'
  - translation
migration_group: migrate_final
label: 'Node translations (Article)'
source:
  plugin: d7_node
  translations: true
  node_type: article
process:
  nid: tnid
  type: type
  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
  content_translation_source: source_langcode
  field_legacy_nid: nid
  field_taxo_industries:
    plugin: iterator
    source: taxonomy_vocabulary_2
    process:
      target_id: tid
  field_abstract:
    plugin: iterator
    source: field_abstract
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_number_of_pages: field_number_of_pages
  field_content_contributor:
    plugin: iterator
    source: field_content_contributor
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_article_type: field_article_type
  field_pdf:
    plugin: iterator
    source: field_pdf_article
    process:
      target_id: fid
      display: display
      description: description
  field_read_view_article: field_read_view_article
  field_link:
    plugin: d6_field_link
    source: field_external_link
  field_taxo_solutions:
    plugin: iterator
    source: field_taxonomy_solutions
    process:
      target_id: tid
  field_taxo_topics:
    plugin: iterator
    source: field_vocabulary_trends
    process:
      target_id: tid
  body:
    plugin: iterator
    source: body
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_related_media_image:
    plugin: iterator
    source: field_image_horizontal
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_pdf_thumbnail:
    plugin: iterator
    source: field_image_vertical
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  field_featured_content:
    plugin: iterator
    source: field_featured_content
    process:
      value: value
      format:
        -
          plugin: static_map
          bypass: true
          source: format
          map:
            - null
        -
          plugin: skip_on_empty
          method: process
        -
          plugin: migration
          migration:
            - d7_filter_format
          source: format
  field_taxo_services:
    plugin: iterator
    source: taxonomy_vocabulary_3
    process:
      target_id: tid
  field_to_be_deleted: field_to_be_deleted
  field_taxo_about_us:
    plugin: iterator
    source: field_taxonomy_about_us
    process:
      target_id: tid
  field_taxo_careers:
    plugin: iterator
    source: field_taxonomy_careers
    process:
      target_id: tid
  field_expert_display: field_display_expert
  field_expert_taxo_industries:
    plugin: iterator
    source: field_experts_tagged_under_indus
    process:
      target_id: tid
  field_expert_taxo_services:
    plugin: iterator
    source: field_experts_tagged_under_servi
    process:
      target_id: tid
  field_expert_taxo_solutions:
    plugin: iterator
    source: field_experts_tagged_under_solut
    process:
      target_id: tid
  field_expert_taxo_topics:
    plugin: iterator
    source: field_experts_tagged_under_trend
    process:
      target_id: tid
  field_invisible_counter: field_invisible_counter
  field_social_share: field_social_share
  field_meta_tags: field_meta_tags
destination:
  plugin: 'entity:node'
  translations: true
  content_translation_update_definitions:
    - node
  default_bundle: my_article
migration_dependencies:
  required:
    - my_d7_node_article
  optional: {  }

Regards
Sunil S.

💬 Support request
Status

Fixed

Version

4.0

Component

API

Created by

🇮🇳India Sunil S. Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States msegura

    Just in case anyone is battling with this the same way I was, if you are editing the .yml file inside the config folder instead of a custom module one. Remember to drush cim and then drush cr everytime you change that file.

Production build 0.71.5 2024