Partial (one-way only) merge of graphs

I would like to take notes on different devices (mobile, different laptops) and merge them to my main machine. I don’t want all notes to show up on all devices.

The use-case is to have Logseq on shared systems and see all the notes on my personal PC, but not the other way around.

Contributing back (editing block that are marked as from a shared system syncs them back to that system) could be useful, but is not essential.

1 Like

Have you considered adding softlinks/shortcuts to the files you want to show up on one machine only? I can imagine that when the other devices cannot see/access those softlinks, they will not show them.

Do know that we officially don’t support softlinks and that they can cause some issues on synced graphs (either using services like iCloud or Dropbox, or Logseq Sync). Make sure you make a backup before trying this out.

2 Likes

Interesting idea!

As a worked example, synchronizing a machine called “external” onto a 2nd local machine, so that the graph on the 2nd machine is not propagated back to the first.

  • Remote (contributing) machine syncs to folder on local machine using syncthing, github, rsync etc.
    • For example, the work computer gets sync’ed to a folder “external”
    • Folder “external” is outside of Logseq folder
  • A local script creates links into the Logseq folder and appends “_external” to every filename
    • This protects from page collisions, e.g. now we have two diary pages “Nov 11th, 2022” and “Nov 11th, 2022_external”
    • Assets are linked into the asset folder if the file doesn’t exist, if it exists the process breaks.
  • The script then appends a page embed, such as “Pages in external folder {{embed [[Nov 11th, 2022_external]]}}” to the end of the corresponding local file.

For pages this should work and be completely transparent to Logseq. It even works bidirectionally, I can directly edit the _external files, and the changes can be sync’ed back to the external machine.
The remaining issue is the assets folder, we need to guarantee that files have unique names globally. In my case (timestamped screenshots) there should be no issue.

@Didac this would also be a case for embedding an external graph inside our local graph as you suggested.

We’ve discussed this in the past, but it would be great if any folder on the system could be a Logseq folder, and graphs could span multiple folders, each with their own asset folder. In this case we wouldn’t even need the links and the asset issue would go away.

Thank you!

Btw, Link Shell Extension is a great tool to manage links on Windows systems

2 Likes