0

So, since I have a little extra time on my hands I’m doing some delayed maintenance on my personal site. You know, removing modules I don’t need anymore, cleaning up taxonomy, etc, etc. There is technical debt on this site because well... you know what they say about cobbler’s children and shoes. When I decide it’s time I’ll be move the site to D9, I want to make the transition smooth. The site has been around a while. It was originally a Drupal 4.7 site which has been upgraded to 5, 6, 7 is currently a D8 site.

So enough preamble, back in the site’s Drupal 5 days I had 4 Drupal sites that I merged into this site. Since there wasn’t a MigrateAPI 12 years ago, I renumbered the NIDs inside the source sites and then copied the database records into the target site. In case I needed to debug things, I left gaps between each of the site’s modes (I added 2000 to the NIDs from siteA, 4000 to the NIDs from siteB, etc) so I could easily tell where the nodes came from.

This is worked and the merged site has been chugging along for over a decade. I’ve come o a point where the system has ~4,000 nodes but the highest NID is approaching 11,000. I don’t see any risk here, I’ve worked on much larger sites. I’m in no danger of exceeding the max number of NIDs anytime soon.

My question is, Is there any benefit to compressing the NIDs (probably by migration to fresh Drupal installation)? I don’t see one, but I might be missing something that someone else can see.

Thanks.

  • 2
    I guess the question is, why would you do this? The node id could be proliferated to any number of tables, and I don't get the benefit in renumbering them. – Kevin Apr 28 at 20:58
  • 1
    Anyway if you use Migrate, the nids will start from 1. I would stick a field on entity types to "track" a value so you know what site they came from. There's no real need to futz around changing entity ids. – Kevin Apr 28 at 22:30
  • @kevin thanks. I just wanted to double check that there wasn't something obvious that I wasn't thinking about. Leaving it as it is. Thanks! – Sean Reiser Apr 29 at 0:54
  • Well starting from 1 if the site is fresh. Otherwise it will start from the next available highest id. – Kevin Apr 29 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.