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.
- Navigate to Configuration → Development → Menu Migration → Settings
- By default, the export folder is set to
../config/menu_migration
, but you can change it to any directory relative toDRUPAL_ROOT
- 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.
- Navigate to Configuration → Development → Menu Migration → Export
- Select one or more menus and click on export
- The items are exported as json in:
<export_folder>/sites/<site_name>/<menu_name>/<menu_name>.json
- To import, navigate to Configuration → Development → Import
- Select one or more menus and click on import
- 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:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion