Document how to perform format mappings in D6/D7 upgrade

Created on 6 May 2016, over 8 years ago
Updated 16 February 2023, almost 2 years ago

Follow-up to #2630578-32: Formats duplicated in D6 upgrade β†’

Should we do any mapping of old formats to somewhat equivalent formats in D8?

'filtered_html' (d6/d7) => 'basic_html' (d8)

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
MigrationΒ  β†’

Last updated about 9 hours ago

Created by

heddn Nicaragua

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.

  • πŸ‡¨πŸ‡¦Canada jmee Canada

    Here are some examples where the migration definition file has been edited, but I think it would be better to use hook_migration_plugins_alter if you need to apply this change everywhere

    In my example, the D7 source site's text formats weren't migrated properly when the site was upgrade to d7, so machine names are in the d6 format.

    Node body field:

    process:
      body:
        -   
          plugin: sub_process
          source: body
          process:
            value: value
            format:
              -   
                plugin: static_map
                bypass: true
                source: format
                map:
                  '1': 'basic_html'
                  '2': 'full_html'
                  '3': 'plain_text'
                  '4': 'plain_text'
                default_value: 'basic_html'
    

    Term description field:

    process:
      description/value:
        -       
          plugin: get 
          source: description
      description/format:
        -       
          plugin: static_map
          source: format
          map:
            '1': 'basic_html'
            '2': 'full_html'
          default_value: 'basic_html'
    

    Or a simple default value also works:

    process:
      description/format:
        -   
          plugin: default_value
          default_value: 'basic_html'  
    
Production build 0.71.5 2024