Is it possible to refactor (rename) a hierarchy like in Dendron?

Hello, I just switched over from Dendron and am enjoying Logseq. One thing that I am a bit worried about is the manual labor if I decide to re-organize my hierarchy. If I e.g. have a number of pages in a hierarchy, e.g.

  • cat_A/cat_B/page1
  • cat_A/cat_B/page2

and want to move cat_A so that is is a child of cat_C:

  • cat_C/cat_A/cat_B/page1
  • cat_C/cat_A/cat_B/page2

Do I have to do this manually for all pages? Or is there a way to do it automatically, updating all links that refer to the old name? Dendron has a “refactor hierarchy” feature which is great at doing this: Dendron: Refactor Hierarchy

1 Like

If you rename cat A to cat C/cat A in Logseq all child pages of cat A will also automatically be renamed and placed correctly in the new hierarchy — at least that worked for me.

2 Likes

Wow, thanks! This is a feature that needs to be highlighted in the docs when they show up.

I discovered one important caveat to the current implementation. Example: I start in an empty graph and add the following content to my journal:

- [[kenya/mombasa]]  
	- [[kenya/mombasa/likoni]]  
- [[kenya/kwale]]  
	- [[kenya/kwale/msambweni]]  
	- [[kenya/kwale/matuga]]

If I then rename kenya/mombasa to countries/kenya/mombasa I and up with two separate trees, i.e.

- [[countries/kenya/mombasa]]  
	- [[countries/kenya/mombasa/likoni]]  
- [[kenya/kwale]]  
	- [[kenya/kwale/msambweni]]  
	- [[kenya/kwale/matuga]]  

so it is important to rename the top node as it is a bit of a hassle to merge them again as we now actually have two kenya pages, one under countries/kenya and one being the original kenya page.

Another issue is that, renaming kenya to countries/kenya does not cascade to rename kenya/kwale and its descendants to countries/kenya/kwale etc.

2 Likes