How to sync your Logseq graph across devices

Welcome to the community @DanielDan!

This post and the comments are meant to create documentation about syncing between devices; it’s not a troubleshooting thread that’s monitored to help people individually.

If you have a question specific to your situation, please create a separate post in #questions-and-help. That will make it easier to zoom in on your situation and it’s monitored by much more people than the comments of a documentation post.

1 Like

I use SyncThing to monitor and sync my Logseq folder. It’s fast, encrypted, cross-platform, and peer-to-peer (doesn’t need a server).

It can use O/S filesystem hooks and sync nearly instantly on file write and detects change collisions. It has an intelligent file deletion queue.

About the only thing i could imagine being better would be real-time live multiuser Google Docs-like editing or a server that natively understands Logseq database transactions.

Dave

6 Likes

@dvorme is one of your devices iOS by any chance and if so are you using Mobius?
If so could you please advise how you overcame this issue "Please choose valid directory" issue on iPhone

1 Like

Just simple way is nextcloud free hosting services…
signup new nextcloud account 2gb to 8gb free hosting services fully works with nextcloud clients (win/mobile/mac) . Nextcloud client also runs as portable (for restirected pc etc) And assign folder of logseq graph to nextcloud folder . Thats it. Instant sync … One problem… doesnt work with iphone because of ios…
as a result we have also same problem with The Syncthing

2 Likes

Hi all,

I am also encountering sync problems and experienced some data-loss (manually recovered either by the Nextcloud version management or Syncthing backups), so I’m finding it not reliable enough. Also, this is the first place I read (in Rameses’ response, I asked on the Matrix channel as well) about the Logseq file/database workflow and why that might produce some sync conflicts, and the need to close the app in one place before opening it in another. I’m missing a bit more thorough documentation on this and the “Refresh” and “Re-index” functions, to better understand how Logseq works and be able not to break it…

I still feel unsure about file integrity and sync, but will try to make sure that I avoid having the app open in many places at the same time. I wanted to ask though: how do you close the app on Android? Just “close” form the running apps list? Does this trigger a “file write” from database to actual files, that would then be propagated elsewhere? Just to minimize my chances of generating sync conflicts…

Thanks in advance!

I use SyncThing:

Yes, thanks for your reply, I use Syncthing myself as well and that’s mainly what has enabled me to manually recover from data loss. Key for me here is “almost instantly on file write”. I would rather Logseq worked directly on files so that this “middle-layer” would be avoided, as that’s what I think makes sync much more complex—and I don’t get what purpose it serves at all btw (but I’m not a developer so that probably also doesn’t help).

I believe that dispensing with that intermediate layer is not possible given the decision taken at the time to adopt the current architecture. I think the way to fix this lies elsewhere, as fixing this issue that way would not outweigh the benefits that this model offers. I suppose that the work that developers are currently doing regarding the synchronization between devices and the service via cloud services goes in that direction, but I don’t know.

Still, in any case, I think that maybe a plugin that captures the raw stream directly from the Hoocks to a FIFO file, could be useful to manage yourself the problems of differences between versions or other possibilities.

1 Like

Sure, and I’m not questioning the decision, just in case it seemed so. Thanks for your detailed overview, I will have a careful look at it ! (adding this to my Logseq journal right away :blush: )

1 Like

BTW, check this:

2 Likes

Hi @Ramses, is there a section dedicated to Logseq Sync in this forum? I’m a Logseq backer and I started using Logseq Sync a few weeks ago. I am very happy with it except that I still get the same error message on launch about the file name format despite using the triple-lowbar format in the settings. Do you know what to do in order to fix it?

What’s the version of Logseq you are using @cyan0245?

Have you tried reset the remote graph?

Can you provide more details?
Can you send some screenshots on the notification & the file names to this email: junyi@logseq.com

Thanks for your answer @Junyi_Du, I really appreciate it.
I run Logseq 0.8.18 on both an Apple M1 Max with macOS Ventura 13.2.1 and an iPhone with the last version of iOS.
Here are some scrennshots of the warning I get on Logseq launch on both devices.





It seems that errors come from some pipe ou € sign in the file names while I’m not sure about it. How could I change these file names without loosing the link in Logseq? Would it be safe to proceed manually this way?
Thanks for your help :wink:

Oh seems they are asset files. It’s not considered by the in-app conversion UI yet. You may have to remove the special characters (like | and : ) from the file manually :melting_face: sorry for the inconvenience
A general tip for naming files: Naming Dropbox files and folders - Dropbox Help

These are files that I’ve picked up here and there. I will clean up their names manually. But for the future, isn’t Logseq supposed to automatically clean up file names when you add them as an asset?

This tutorial doesn’t make any mention of the importance of encrypting your data when pushing it to remote repos, or cover steps to do that.

See this link for a discussion and brief how to in the Obsidian community: [Mobile] Sync with git on iOS for free using iSH - #17 by evergreensnow - Share & showcase - Obsidian Forum

Have brought this up in other threads here (Alternative way of git syncing on iOS using a-shell for free - #10 by smart.pen5644).

We need a good, easy, and secure way to sync their data across devices. Am willing to pay for Logseq sync once that works without issues.

2 Likes

@smart.pen5644 FYI Logseq Sync works well now and there is also Syncthing to sync files in general without a third-party server (it’s peer to peer):

https://syncthing.net/

May I know how this works with the iOS sync macOS approach? I’ve failed weirdly with this approach, as loges requires me to use only files in the logseq icon on iOS, which means I must first create logseq graph on iOS and then sync it to Mac. But then the Mac only gets the logseq parent folder, without syncing the child graph folder (let’s say my graph is name digital garden) it magically disappears in my Mac but appears in my iOS. Obsidian works perfectly well with iCloud and syncthing, but logseq sucks at both syncing methods. Is there a simple and reliable free way to sync just between apple devices?

how about implementing something like:
Operational Transformation

it’s what the cloud platforms like GD uses. Since you’re already using a db for storage?

if we could clearly define the operations that needs to be performed, it’s something that could be worked on.

It is somewhat simple - you need a full-featured syncthing client (I ended up using the paid version of Mobius Search) which allows you to sync to files in a folder other than the syncthing client’s folder (Mobius search premium does this). You can then declare your syncing folder inside the Logseq folder on your ios device. And since it’s in the logseq folder on your device, you can access it from Logseq.

Mind you I haven’t completely gotten my workflow together on this, but I got far enough that I could sync between my computer and logseq via syncthing. I encountered some merge-conflicts while testing and haven’t been able to look into what’s going on enough to be comfortable adopting it.