I'm doing something new here which is contributing a how-to rather than directly asking a question. My hope is that others will contribute if they know more or find additional info.
I've run into this situation a couple times where I have nodes in a site and I want to set up an entirely new site instance and grab only the partitcular nodes I want and migrate them. I've tried the node export module...no idea what that's supposed to do but it doesn't do this. So here's what I've come up with so far (actually I'm doing this for a custom node type I made that stores info in a special table so this may be a little different for normal nodes):
- In phpMyAdmin find the particular nodes you want in "node" table and export them and import into your new DB.
- Do the same for node_revisions.
- Here I had to grab another table of custom data and pull that over too.
- Now I think this is completely optional, but I re-IDed all my nodes so they start at 1 and increment. I only had 22 nodes to move so this wasn't too bad. If you have a bunch and they are odd IDs I don't think you need to worry about it.
- You DO need to worry about the sequences table. This is not optional. Change "node_nid" and "node_revisions_vid" to reflect the ID of the highest ID number in your group of nodes. This way you will not get collisions.
That's what I've found so far. Seems to work ok but I'll update if I find anything else out. These nodes do not have comments or anything like that so I don't know if extra steps would need to be taken in that case. I have another set of nodes I'd like to do this with that do so maybe I'll update then. This is also for D5 so when I do ti for 6 I may update also. I hope this is helpful to someone. Please feel free to contribute.