Disable entity hierarchy calculation during migration

Created on 24 March 2023, over 1 year ago
Updated 25 March 2023, over 1 year ago

Problem/Motivation

I'm migrating a large hierarchy ~4,000 nodes from d7 node hierarchy to d9 entity_hierarchy; including revisions, node complete migration is ~29,000 rows and migrate performance is glacial. I suspect constant recalculation of nested set. Before I go poking around the code is there an easy switch to disable calculations during migration? The plan is to migrate field values, then after migration run drush entity-hierarchy-rebuild-tree to build the nested set data...

If there is no easy switch, please advise where the best place to intervene would be. FYI, I'm using plain entity_hierarchy on nodes, not microsite etc.

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.0

Component

Code (module)

Created by

πŸ‡³πŸ‡ΏNew Zealand jonathan_hunt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathan_hunt
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Yeah there's a state flag to disable it and a drush command to rebuild it after re-enabling

    On my phone at the moment but will get the state flag name for you tomorrow

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    The flag is entity_hierarchy_disable_writes

    drush sset entity_hierarchy_disable_writes 1

    And when done, use drush sdel to delete it and run the rebuild command

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand jonathan_hunt

    @larowlan Argh, it's right there in the README! How did I miss that? Thanks for the pointer.

Production build 0.71.5 2024