Posted by kruser on October 9, 2009 at 2:28pm
| Project: | Node export |
| Version: | 7.x-3.x-dev |
| Component: | Node export |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
First off, this is a great module, nice work.
Looking at the export file the plid is exported correctly, but mlid is always 0 for every node, so upon import, the hierarchy isn't built correctly and in my case some of the pages were becoming children to admin_menu links because the plid matched a previously existing mlid.
I know that there is an option to wipe out the imported menu links, but when importing about 200 pages nested about 4 levels deep, trying to rebuild the hierarchy by hand can be quite time consuming. So hopefully there is a fix to maintaining the hierarchy upon import.
Thanks.
Comments
#1
I am not aware of a solution to this. This module isn't designed to export a whole site structure - the bulk functionality is kind of an afterthought and a lot of things like book and menu structures, and reference fields, do not get imported properly on the new site.
If you have a good understanding of drupal's api, database, menus, etc.. you might be able to think of a way around this, if so... let me know how :P Imagine if you forget to export one node in a hierarchy - what happens to the hierarchy? It seems like you would need a totally different approach to the whole export - you might write a module to export the menu structure, which would use node export to attach the nodes into it's own export. Or perhaps an option to node export to 'also export dependencies' or soemthing like that and it would add in any nodes you forgot.
#2
This is closely related to http://drupal.org/node/601458 and a suitable strategy to solve one issue may prove effective for the other.
#3
#4
I may have a solution for this.
I'm building a module that allows importing/exporting an entire menu hierarchy to solve a data migration challenge on a site. I think this module would make the most sense being a submodule of node export since I'm borrowing heavily from it anyway. :-)
Basically what the module does is add Import and Export tabs when you're viewing a given menu at /admin/build/menu-customize/menu-name.
The export tab works pretty much exactly as the node export, dumping an array of the menu tree.
The import tab takes that exported menu tree array and iterates over it creating menu entries. It does require that all of your nodes have URL aliases and that the aliases are identical between sites. That's how I get around the issue with the node IDs changing.
I still have a few issues to work out, but should be able to upload some code by the end of the weekend.
#5
Here is a submodule for handing the export/import of an entire menu tree.
I've attached a .gz of the new submodule. No changes were made to the base node_export module. Just drop this module into the node_export/modules folder.
#6
That's awesome. I can't wait to test it out. I'll let you know how it goes.
#7
thank you Shawn_Smiley, your module did exactly what I needed :)
#8
I didn't have much luck with shawn's module. Does it not work if you try to import into the same site?
I would have added it to this project, but apart from checking node export's settings I don't really see how it integrates with this module. The module could be useful for some people, but I don't think it solves the problems of this issue. You could consider creating a new project to further develop/maintain a menu export perhaps.
#9
Subscribing, greetings, Martijn
#10
Development of features on this module will now be focused on 7.x-3.x-dev, with backports possible after fixing.
#11
I wonder if relating this issue with this one might help, Export Menu links with UUID
And this seems like it could offer a potential path forward, UUIDs for Menu Links