Archived Documentation (up to version 3.0.0)

Last updated on
29 June 2024

Features

  • Works with multisites
  • Handles translations (starting 2.0.0-alpha3)
  • Handles hierarchies
  • The exported files are independent from the source site
  • Offers drush commands for automation
  • Can only handle MenuLinkContent items

Configuration

The menu items are exported as json in a folder on the server, defined in the configuration form provided by the module.

menu migration settings page

  1. Navigate to Configuration → Development → Menu Migration → Settings
  2. By default, the export folder is set to ../config/menu_migration, but you can change it to any directory relative to DRUPAL_ROOT
  3. When you save this form, you might get an error about permissions, so please make sure that the selected folder has write access for either webserver user (if you plan to use the interface) or the shell user (if you plan to use drush), or both.

Export menu items page

  1. Navigate to Configuration → Development → Menu Migration → Export 
  2. Select one or more menus and click on export
  3. The items are exported as json in: <export_folder>/sites/<site_name>/<menu_name>/<menu_name>.json

Import menu items page

  1. To import, navigate to Configuration → Development → Import
  2. Select one or more menus and click on import
  3. When importing, all MenuLinkContent items that exist in the target menu(s) will be deleted prior to import

Automation

Menu migration provides two drush commands for managing imports and exports. You can import one or more menus at a time. If you want to import more than one, the menu names need to be separated by commas.

Export menu items with drush

# Export "main" menu.
drush menu_migration:export main
# Export "main", "footer" menus
drush menu_migration:export main,footer
# Alias for export "main" menu.
drush mme main

Import menu items with drush

# Import "main" menu.
drush menu_migration:import main
# Import "main", "footer" menus
drush menu_migration:import main,footer
# Alias for import "main" menu.
drush mmi main

Help improve this page

Page status: No known problems

You can: