Menu migration

Last updated on
30 April 2025

Menu migration defines no arguments beyond the common ones. Menus themselves just have names, titles, and descriptions to migrate.

$menu_arguments = $common_arguments + array(
  'machine_name' => 'ExampleMenu',
  'description' => t('Import Drupal 6 menus'),
);
Migration::registerMigration('DrupalMenu6Migration', 
  $menu_arguments['machine_name'], $menu_arguments);

Menu links are more complex, and require a few arguments:

  • menu_migration: The machine name for your menu migration, so links get assigned to the correct menu.
  • node_migrations: An optional array of node migrations, required in order to update nids in link_path.
  • term_migrations: An optional array of term migrations, required in order to update tids in link_path.
$menu_link_arguments = $common_arguments + array(
  'machine_name' => 'ExampleMenuLink',
  'description' => t('Import Drupal 6 menu links'),
  'menu_migration' => 'ExampleMenu',
  'node_migrations' => array('ExamplePhotoNode', 'ExampleVideoNode'),
  'term_migrations' => array('ExamplePhotoTerm', 'ExampleVideoTerm'),
);

Migration::registerMigration('DrupalMenuLinks6Migration', 
  $menu_link_arguments['machine_name'], $menu_link_arguments);

If you are migrating a menu from D6 with the machine name 'primary-links', this menu will be "ignored" by your ExampleMenu migration, and during the ExampleMenuLinks migration the machine name 'primary-links' will be changed to 'main-menu' #2227471: D6 Menus Ignored By Name

Help improve this page

Page status: Not set

You can: