Problem in "Attach link to file" using 2 computers with the same Base Directory (in Onedrive)

Hi everyone!

I'm using ZotFile and 2 computers to access Zotero. It means that both computers have the same Base Directory (stored in OneDrive):
PC n. 1) O:\OneDrive\zoterodb
PC n. 2) C:\Users\grj\OneDrive\zoterodb

If anyone wants to know how to set up this, follow the instructions in this video: https://www.youtube.com/watch?v=MfFXQ5JYPeA

This works pretty well for files stored in OneDrive\zoterodb, but I'm having problems attaching a new "link to file" in one of these PCs when I select a file that IS NOT in the OneDrive\zoterodb, but in ANOTHER folder in OneDrive.

For Example:
In PC n. 1, I select create a new "link to file" and choose the file in OneDrive (like O:\OneDrive\Folder\File). This creates a "link to file" that works well on PC n. 1.

But when I try to access the same file in PC n. 2, I get the following error:

"The attached file could not be found at the following path: O:\OneDrive\Folder\File
It may have been moved or deleted outside of Zotero, or a Linked Attachment Base Directory may be set incorrectly on one of your computers".

This happens because the file paths are different in both PC's
In the PC n. 1, the file path is: O:\OneDrive\Folder\File
In the PC n. 2, the file path is: C:\Users\grj\OneDrive\Folder\File

Is there any way to solve this?

I don't want to save these files in zoterodb because I already have them stored in OneDrive, so I don't want to duplicate them. And I don't want to attach "link do URL" because if I do so and click on the item, it opens in the browser (and additionally, it requires me to have previously shared this specific file in OneDrive and obtained a specific link for it).
  • Firstly, you don't have the same "base directory". The Onedrive folders you listed have a different path. So I assume you have a Linked Attachment Base Directory set on each computer (in Zotero preferences), to those different parent paths for linked files ?

    But the LABD is probably not playing into your issue. The LABD only helps for files that are under a LABD. When you create a link to an attachment file outside the LABD on any computer, it is stored in Zotero's database as an explicit path. What else could Zotero do in that case ?

    Then, since that file is outside the LABD, how could Zotero possibly find it on the another computer if it's not at exactly the same explict-path location ? Zotero has no information that would allow it to do that.

    The solution is to only link attachment files under the LABD on each computer or, if outside the LABD, for those files to be at exactly the same path on each computer. If you already have those PDFs in Onedrive (not under the LABD, and at different paths on each computer), you would move them (not copy, since you said you don't want to duplicate) into zoterodb. Or set the Onedrive path to be identical on each computer (the same as on PC 1, if you have already added any explicit-path links on that computer).
  • edited August 17, 2024
    Hi Tim,

    Firstly, thank you for your quick response. Your observations are completely right. Sorry for the confusion in the first message.

    Perhaps my problem requires a solution considering the use of Calibre AND Zotero.

    I use Calibre for the storage of books and files and Calibre's Library is in OneDrive. I could move the Calibre's Library into the ZoteroDB. This would solve one problem but perhaps would create another: Calibre storage files in a specific folder structure (Author\Name of the file\file) and, therefore, if I change the metadata of these files in Calibre (for example, correcting the name of a book or changing the author's name), Calibre will change the folder's path (using now the correct Author's name and the right name of the book). These changes will not be considered in Zotero, so the folder path will remain invalid and I won't be able to open the file in Zotero...

    Additionally, Calibre doesn't allow me to directly change (in Windows Explorer, for example) the name of any folder or file. I can try to change it, but Calibre will immediately rename the folder and file considering the metadata of the book). Therefore I also could not use the "Rename File From Parent Data" function in Zotero.

    Any clue on how to deal with that?

    Thanks in advance!
  • edited August 18, 2024
    As long as the Calibre folder structure is under the Zotero LABD parent folder, everything should at least work (ie Zotero will find linked files you ask it to open) ... as long as files stay in the sub-folder in which they were originally added to Zotero as linked attachments.

    Presumably Calibre metadata changes - with consequent file movement - are relatively rare. In which case you would just have to update the Zotero link when you know a file's location has changed.

    Rather than using Zotfile, you may be better off dragging files from their sub-folders into Zotero as linked files.
    https://www.zotero.org/support/attaching_files#adding_files_via_the_zotero_window

    In time, you might decide that trying to maintain files under two systems whose software does somewhat similar things outweighs any benefits. ;)
  • edited August 18, 2024
    "Somewhat similar things" is a very subjective concept :-)
    My own use cases for Zotero and Calibre, respectely, are quite different and there's no way I could use only one of them for all of my e-books. But I'd love to see some smooth interaction between them, perhaps there's an idea for a plugin in that area (either on the Zotero side or on the Calibre side).

    Anyway, since the current discussion involves Onedrive, it might be worth repeating the strong warnings from the Zotero and Calibre FAQs regarding NAS/network/cloud drives:

    https://www.zotero.org/support/kb/using_multiple_computers

    https://manual.calibre-ebook.com/faq.html#i-am-getting-errors-with-my-calibre-library-on-a-networked-drive-nas

    In Zotero, you can use a network drive for your Linked Attachment Base Directory, but not for the main Zotero folder (EDITED first I thought the video wasn't doing it right, but it is actually correct). In Calibre, using a network drive is essentially unsafe.
  • edited August 18, 2024
    TBH I'm not that familiar with Calibre. ;) I did look up the way it creates folder locations for each individual book (which makes Zotero links a little more complex than if every book were in a single folder).

    The video is basically correct though, in that it only shows setting the LABD under Advanced Preferences (to Google Drive in the example shown). The Zotero database is not moved. It does use Zotfile (under v6), which must be replaced by zotmoov or attanger in Zotero v7.

  • There is a Calibre plugin to sync with Zotero, but it is too complicated for me and I realy don't know how to use it. A tutorial would be great

    https://forums.zotero.org/discussion/60898/calibre-zotero-metadata-importer-plug-in

    PS: My Library in Calibre is a folder in OneDrive and it has been working fine for almost 3 years
  • I'll take a look at the plugin, thanks for the pointer.

    As for how long you've been using Onedrive for your Calibre library, well, it's the common denominator of many calls for help on the Calibre forums. "It's been working fine for XX years, and now it doesn't". The official documentation is there for a reason, but you're free to ignore it of course.
  • Good Luck Aborel. If you have any tips on how to use and configure that Calibre Plug-in, please share.

    Thank you All for your help
Sign In or Register to comment.