We are attempting to import multiple large Confluence spaces with hierarchies going several levels deep and many of the pages having very long names into XWiki. Due to this we cannot execute the Nested Pages Migration for these spaces, as the resulting paths will exceed 255 characters. It would of course be possible to manually rename or reorganize the pages, but for hundreds of pages this gets very time-consuming and I assume that other companies migrating their production spaces will encounter the same issue. I therefore think it might be preferable to adapt the Confluence importer and/or Nested Pages Migrator to truncate the page names (but not the page titles) automatically, especially since XWiki SAS will be providing the simple importer UI.
I have attempted to solve this by adding an option to truncate long page names to the Confluence importer. However I am not sure if this is the correct way to do this. Using this code the page names will be changed, but the page title will be kept. However backlinks to the truncated pages break, since the links use the page title (this could probably be handled when resolving links). Unfortunately, the Nested Pages migrator will undo the truncation for all parent pages. Only the pages at the bottom of the hierarchy will keep their truncated names, all above them will be renamed back to their original title. I do not know if I have overlooked some place I should have specified the truncated name of the parent page or if the Nested Pages migrator uses the page titles during migration. I tried looking into the migrator code but I wasn’t able to find the place where I would have to make changes.
Is adding the functionality for automatically truncating page names an option for the Devs or XWiki SAS (since they stated they would work on the importer and Nested Pages migrator)? Or is there a better way we could make imports with long path names work? Asking potential users to rename and reorganize much of their data does not feel like a good option to me.
Thanks for your help!
BTW is there a reason the most recent changes to the NPM haven’t been released? When using the version from GitHub I realized a couple of things had changed (nothing solving the stated problem), but the last real commit was in 2017.
EDIT: The used versions for clarification:
Confluence importer: 9.5.1 (from extension manager) and 9.5.2-SNAPSHOT (as in above commit)
Nested Pages migrator: 0.7 (from extension manager) and 0.8-SNAPSHOT (from the official repo)