[iOS] [JB] Zotero local file sync with Resilio Sync for free

Many people who use Obsidian also use Zotero, which is especially useful on a tablet (I cannot read any text for long on a PC).

Since Box.com discontinued support for WebDAV for good and Mega.io (MEGAcmd) seems difficult to set up (I’m not sure one can install all dependencies on the iOS terminal), I stopped using Zotero for a while. Then one day I found time to look for a solution. First, I was thinking along the lines of rsync but I quickly moved on to settle on Resilio. I had an idea.

Using a local sync sans a cloud storage provider is easy to set up with an Android tablet but well nigh impossible on iOS (as we all know from Obsidian note sync). Here is where a jailbroken device comes in handy.
I am not going to waste time here on how to set up and link your devices (Resilio is also available to download/install on Linux as well as Windows, by the way) as there is plenty of official help available online. I only want to stick to the hack.

On a different thread, I already hinted at using symlinks with the JB file manager app Filza. This is what we’re going to use here again.

On both PC and iOS Zotero, we continue using the data sync with Zotero but we need to disable WebDAV for file storage. We’re going to use local sync only.

On PC, add a dummy folder and a dummy file in it to see where our file goes (user/Zotero/storage). On iOS, we add some PDF from the net using the share sheet. On iOS, using Filza, we navigate into the subfolders of group.org.zotero.ios.Zotero under /var/mobile/Containers/Shared (just search for zotero).
What we’ll see is a downloads folder with a custom_my_library folder, under which our Safari downloaded stuff gets populated. Quit Zotero and rename this folder custom_my_library2.

  • Most of you probably already realized that Zotero PDF’s are kept in folders named with a hexadecimal string.

In the meantime, we sync our dummy file over to the iPad. You might want to quit Resilio afterwards.

Now, again in Filza, look for group.com.resilio.sync, again under /var/mobile/Containers/Shared. Navigate into where your storage folder is, synced over from Zotero PC. Make a symlink of storage (leave relative path unticked), cut it, and move over to the Zotero folder where your custom_my_library2 folder resides and after pasting the symlink there, rename it to custom_my_library. If there is anything you need from custom_my_library2, move it into custom_my_library and delete custom_my_library2. We don’t need it anymore.

It seems like a lot to take in but it’s not much, once you go through the steps. All we have done is connected, or rather, merged the Resilio sync folder with the Zotero folder which is used for Safari downloads.
From now on, if you add PDFs on either end and use Resilio Sync (you need to keep it in the foreground on iOS), your files will be synced. Make sure you turn Selective Sync off on the mobile device, otherwise you’d need to do sync one by one. (On PC, it is the default setting on the free version of the program.)

From now on, you’ll be getting error messages when you add files to Zotero on mobile and when the iOS app wants to sync with WebDAV, but you just ignore these errors. Your files are still added and when initiated through Resilio, synced notwithstanding these messages.

  • Again, you need to select: Zotero for Data Syncing and select: WebDAV under File Syncing, but you’ll just leave the username and password empty.

It goes without saying that with this method you can also try syncing Obsidian files themselves locally without using a cloud service. But you will need a jailbreak to implement symlinks. I am not sure how good Resilio sync is with small and hidden files, but probably it would do fine.

One other thing: one always needs to be cautious when updating apps on iOS, as the unique ID under the Container folders is changed. The same thing is true with Obsidian: I need to run a Shortcut with the PATH using the new UUID in order to use my Obsidian-related shortcuts. But these folders we were using above are not under /var/mobile/Containers/Data, but /var/mobile/Containers/Shared. I am not sure if they get affected on Zotero or Resilio app updates. Probably they do.

If someone has more patience than me, they can also find a way to use sync mixed with WebDAV (try Koofr, for instance), but because I often add PDFs while browsing Safari on the iPad, I was just focusing on syncing the folder under downloads.

Hi

I am wondering why you just don’t subscribe to Zotero’s file sync. It works so well and is so cheap that I couldn’t justify using another method. But I may have missed the point.

Title (as in: free) says it all.

By the way, Zotero could have not allowed WebDAV sync (or linked files, third-party add-ons, etc.) or Obsidian could also not allow sync if it was a cloud service. But they do. It’s not like I am being a pioneer here with my great symlink shortcut idea. It’s an exercise. You’ll have to forgive me for making it public.

Sorry if my comment sounded harsh, it was not my intent. I wanted to better understand the possible other advantages (other than being free) compared to the simpler paid solution. Thanks for sharing your idea.

1 Like