Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have tried this using migrate and building menu.inc and menu_links.inc files based on the examples in migrate_d2d. I have also tried to migrate menus and menu links using migrate_d2d and I've gotten exactly the same results.
Only 17 of 1415 menu links are migrated. All others are ignored, even when I set migrate to update existing links. It appears that links in the D6 primary and secondary links menus get passed. But no links in the navigation menu are passed to D7. I get no error messages, so I don't know why 1398 links are ignored.
Comments
Comment #1
rsbecker CreditAttribution: rsbecker commentedI solved the problem. In the migration I created a new menu for my old nav menu, which includes most menu links created thru the UI that point to site content.
Nothing in the documentation discusses mapping old menus to new ones. Migrate_d2d maps primary-links to main-menu and secondary-links to user-menu(?)' but not the others.
Comment #2
mikeryanSorry, I've never used the menu migration stuff myself - anyone in the community who has have any insight?
Comment #3
rsbecker CreditAttribution: rsbecker commentedIt's not a problem. I figured out what I did wrong.
I think there is a need for some documentation. That is a todo in the handbook pages.
Comment #4
techysafi CreditAttribution: techysafi commentednow Im trying to figure out what i am doing wrong :/ same problem here... most of the menu links are being ignored.
any changes you had to make in code level?
Comment #5
rsbecker CreditAttribution: rsbecker commentedHere's what I did.
1. Create a map of menus on the D7 site that correspond to menus on the D6 site.
Then I pirated the menu and menu_links classes from migrate_d2d, replacing the following code at the bottom of the menu.inc file:
with the following:
Then, in the menu_links.inc comment out the following:
In the query for basic menu_links data add the following condition to get only links from the menus you plan to migrate:
In my case all of the site-specific links were in the D6 site's menu-global-nav.
In the code that steps thru the D6 site menu links replace the following:
with a call to the function that translates menu names:
That will create the new site-menu on the D7 site and migrate primary- and secondary-links menus. It will also rename the main- and user-menus. I'm sure there is a way to keep the D7 names, main-menu and user-menu, but I wasn't concerned enough to figure it out.
I hope this helps
Comment #6
techysafi CreditAttribution: techysafi commentedwhere do i put this property? feeling lost :/
Comment #7
rsbecker CreditAttribution: rsbecker commentedYou could put it above the construstor. If you have a my_migration.migrate.inc file you could put it in an abstract class. Then call it from node.inc.
Comment #8
mikeryanNo open question left here....
Comment #9
berenddeboer CreditAttribution: berenddeboer commentedHaving the same problem with all links being ignored, the issue seems to be that the router_path field is not filled.
It's not filled in the source either. In the cases I have examined this so far, the router_path is empty for an alias or external link in D6.
Comment #10
nerdcore CreditAttribution: nerdcore at OpenConcept Consulting Inc. commentedSorry to re-open this, but I've also stumbled upon this issue.
While reading migrate_d2d/d6/menu_link.inc I am curious what the purpose is behind Line #81:
Why does migrate_d2d only migrate D6 menus "primary-links", "secondary-links", and "menu-*"? Why not "navigation"?
Comment #11
nerdcore CreditAttribution: nerdcore at OpenConcept Consulting Inc. commentedComment #12
coterj CreditAttribution: coterj commentedI am having a similar issue- I tried posting about it under a new topic last week. However I wasn't getting any traction on that posting. If any of you see this- could you take a look at my posting?
https://www.drupal.org/node/2834087
Comment #13
coterj CreditAttribution: coterj as a volunteer commentedHappy New Year everyone- has anyone had a chance to look at the posting I made here around 3 weeks ago? (^^^its right above this posting I could still use some guidance if anyone has time?