D7 to D9 Migration

Created on 16 December 2022, almost 2 years ago
Updated 9 December 2023, 11 months ago

D7 to D9 Migration by example:

After migration (as you need to have all your content types migrated) configure Exclude Node Title first at:
/admin/config/content/exclude-node-title

Check "Exclude Node Title" checkbox at least for one node in D9 to get it into nodelist ("nid_list") below.

# D7 - field contains nodes only:
SELECT VALUE FROM variable WHERE NAME='exclude_node_title_nid_list';
You will get list of nodes, e.g.:
a:28:{i:0;s:5:"18805";i:1;s:5:"19099";i:2;s:5:"19123";i:3;s:5:"19234";i:4;s:5:"19270";i:5;s:5:"19802";i:6;s:5:"19888";i:7;s:5:"19893";i:8;s:5:"19973";i:9;s:5:"19978";i:10;s:5:"19986";i:11;s:5:"19989";i:12;s:5:"20012";i:13;s:5:"19952";i:14;s:5:"20066";i:15;s:5:"20186";i:16;s:5:"20197";i:17;s:5:"20228";i:18;s:5:"20227";i:19;s:5:"20247";i:20;s:5:"20253";i:21;s:5:"20341";i:22;s:5:"20344";i:23;s:5:"20377";i:24;s:5:"20386";i:25;s:5:"20353";i:26;s:5:"20412";i:27;s:5:"20462";}

Change above with find-replace to this and insert it after "nid_list"; into text and then into the cell for D9 below:
a:28:{i:0;i:18805;i:1;i:19099;i:2;i:19123;i:3;i:19234;i:4;i:19270;i:5;i:19802;i:6;i:19888;i:7;i:19893;i:8;i:19973;i:9;i:19978;i:10;i:19986;i:11;i:19989;i:12;i:20012;i:13;i:19952;i:14;i:20066;i:15;i:20186;i:16;i:20197;i:17;i:20228;i:18;i:20227;i:19;i:20247;i:20;i:20253;i:21;i:20341;i:22;i:20344;i:23;i:20377;i:24;i:20386;i:25;i:20353;i:26;i:20412;i:27;i:20462;}

# D9 - field contains both config and nodes:
SELECT DATA FROM config WHERE NAME='exclude_node_title.settings';

a:7:{s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"0yJNd4uWv8TzhYEPQBDiApPL2e8ar88kBmQrzDjNCqc";}s:8:"nid_list";a:28:{i:0;i:18805;i:1;i:19099;i:2;i:19123;i:3;i:19234;i:4;i:19270;i:5;i:19802;i:6;i:19888;i:7;i:19893;i:8;i:19973;i:9;i:19978;i:10;i:19986;i:11;i:19989;i:12;i:20012;i:13;i:19952;i:14;i:20066;i:15;i:20186;i:16;i:20197;i:17;i:20228;i:18;i:20227;i:19;i:20247;i:20;i:20253;i:21;i:20341;i:22;i:20344;i:23;i:20377;i:24;i:20386;i:25;i:20353;i:26;i:20412;i:27;i:20462;}s:16:"translation_sync";b:1;s:6:"search";b:0;s:4:"type";s:6:"hidden";s:13:"content_types";a:20:{s:2:"ad";s:4:"none";s:7:"article";s:4:"user";s:6:"author";s:4:"none";s:4:"blog";s:4:"user";s:18:"bootstrap_carousel";s:4:"none";s:10:"cme_course";s:4:"user";s:8:"feeditem";s:4:"none";s:5:"forum";s:4:"none";s:5:"image";s:4:"none";s:5:"issue";s:4:"none";s:11:"long_answer";s:4:"none";s:11:"multichoice";s:4:"none";s:4:"page";s:3:"all";s:4:"poll";s:4:"none";s:4:"quiz";s:4:"none";s:8:"sco_node";s:4:"none";s:12:"short_answer";s:4:"none";s:9:"simpleads";s:4:"none";s:9:"truefalse";s:4:"none";s:7:"webform";s:4:"none";}s:18:"content_type_modes";a:20:{s:2:"ad";a:0:{}s:7:"article";a:2:{i:0;s:4:"full";i:1;s:6:"teaser";}s:6:"author";a:0:{}s:4:"blog";a:2:{i:0;s:4:"full";i:1;s:6:"teaser";}s:18:"bootstrap_carousel";a:0:{}s:10:"cme_course";a:2:{i:0;s:4:"full";i:1;s:6:"teaser";}s:8:"feeditem";a:0:{}s:5:"forum";a:0:{}s:5:"image";a:0:{}s:5:"issue";a:0:{}s:11:"long_answer";a:0:{}s:11:"multichoice";a:0:{}s:4:"page";a:2:{i:0;s:4:"full";i:1;s:6:"teaser";}s:4:"poll";a:0:{}s:4:"quiz";a:0:{}s:8:"sco_node";a:0:{}s:12:"short_answer";a:0:{}s:9:"simpleads";a:0:{}s:9:"truefalse";a:0:{}s:7:"webform";a:0:{}}}

Flush all caches and check one of your nodes in D9.

πŸ“Œ Task
Status

Active

Version

1.4

Component

Miscellaneous

Created by

πŸ‡¨πŸ‡¦Canada gennadiy

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 trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

    This worked for me.

    id: exclude_node_title
    label: Exclude node title config
    migration_group: my_migration
    migration_tags:
      - Content Migration
    
    # This will skip processing if the source variable is missing.
    source:
      plugin: variable
      variables:
        - exclude_node_title_nid_list
      variables_no_row_if_missing:
        - exclude_node_title_nid_list
    
    process:
      nid_list:
        -
          plugin: get
          source: exclude_node_title_nid_list
        -
          plugin: multiple_values
        -
          plugin: migration_lookup
          migration:
            - node_carousel
            - node_event
            - node_flexible_page
            - node_news
            - node_person
        -
          plugin: single_value
        -
          plugin: callback
          callable: array_filter
        -
          plugin: callback
          callable: array_values
    
    destination:
      plugin: config
      config_name: exclude_node_title.settings
    
    migration_dependencies:
      optional:
        - node_carousel
        - node_event
        - node_flexible_page
        - node_news
        - node_person
      
    
    
Production build 0.71.5 2024