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 need to import content from one site to another with completely same nid values. Can I do it with this module?
Comments
Comment #1
kmajzlik CreditAttribution: kmajzlik commentedNO.
Comment #2
danielb CreditAttribution: danielb commentedOf course you can. The new imported node will be assigned a new nid, unless it has the same UUID as an existing node - in which case you can choose whether to create a new node, create a revision on the existing node, or skip the import. UUID is used by this module to identify a node, as nids are unreliable (different site can have different nids).
Comment #3
danielb CreditAttribution: danielb commentedUnless you meant you wanted to preserve nids in the import, in which case, no... but the real question then becomes why would you want this, and perhaps finding a way to address that problem.
Comment #4
danielb CreditAttribution: danielb commentedBasically here's the deal: nids are automatically created by the database, there isn't really a way around it unless you want to get real hacky about it. While nids are the primary identifier for a node, when you get into a situation where you're dealing with content across multiple sites, nids become trouble and cannot be used to identify a node. In my experience the best way to identify a node is with UUID. It would be nice if it UUID was built into Drupal nodes by default, but it is not. So what you have to do is figure out how things on your site interconnect with each other, and if it's by nid, then that's gonna have to change - at least temporarily - to UUID.
That's how node export works when it needs to point to another node by nid - temporarily replace the relationship with UUID - then restore the nid relationship based on the new ids.
Hope this gives you some ideas.
Comment #6
brandy.brown CreditAttribution: brandy.brown commentedThe problem is that this module does not completely work. Therefore, some people need to pull actual database tables to make up for content that this module cannot migrate. It makes zero sense why it would change the NID. NIDs are not unreliable. You can insert NIDs the same way that you're inserting all the other data.
Comment #7
brandy.brown CreditAttribution: brandy.brown commentedI'm marking this as works as designed since you did not FIX anything. Instead, you simply said NO. I just moved on to use a different module since this one is not comprehensive and does not work properly.
Comment #8
ngocketit CreditAttribution: ngocketit commentedHas anybody figured out how to do it yet? Is updating the node ID after importing ok?
Comment #9
killwaffles CreditAttribution: killwaffles commentedIn dire need of this functionality! I have an old D6 site that was brought to D7 just to be able to migrate the content over to another D7 site that was worked on by some predecessors that left ZERO documentation on there initial migration process. The one thing I know for certain is that the NID's match up perfectly. There are also view contextual references which depend on entirely on an NID.
Comment #10
szubkov CreditAttribution: szubkov commentedMaybe my solution would be helpful:
(drupal 7)
Comment #11
candelas CreditAttribution: candelas as a volunteer commentedThanks @FeintEars ;) It works!
Comment #12
droddis CreditAttribution: droddis commentedthis little custom module worked great! Thanks very much @FeintEars
Comment #13
howdytom CreditAttribution: howdytom as a volunteer commented@FeintEars: Thank you for sharing. This is exactly what I was looking for d7 1:1 migration. It's working like a charm.