Sync database in two systems using Zotero+Dropbox+Zotfile

(I read this thread https://forums.zotero.org/discussion/55466/zotfile-dropbox-zotero/#Item_0 but it is not what I'm looking for)

I have Zotero installed in my desktop PC and my Laptop. All my PDF attachments and the Zotero database are synced via Dropbox, which so far worked perfectly well.

A few days ago I decided to install the Zotfile extension to be able to store all PDFs in folders according to their year of publication (as opposed to what Zotero does which is keep each PDF in a single folder with a random name)

This worked alright in my desktop PC, I just had to rename all my stored articles so that Zotfile could move them to their new location stored in folders named as years.

The issue is that when I go to my laptop (after Dropbox synced all PDFs into their new location and the Zotero database), the Zotero client there won't find any of the attached PDFs. I've pointed both Zotero and Zotfile to the correct folder, to no avail.

I presume Zotfile (or Zotero) stored the full paths to each PDF taken from my desktop PC, and now it doesn't care that I indicate the correct folder where the PDFs are located.

Is there any way to get this right?
  • All my PDF attachments and the Zotero database are synced via Dropbox,
    don't sync your Zotero database with Dropbox. You're setting yourself up for disaster and we won't be terribly inclined to help you with troubleshooting, as the location of the database is the most likely cause of any issues you'll be encountering.

    For your question, you need to set up a relative links base folder on both machines, pointing to the respective location of the Dropbox folder (or the Zotero folder within it -- doesn't matter).
  • Hi Adam,

    I've been syncing my database with Dropbox for I'd say years now. I do this because that's how I keep my PDF attachments synced across my devices.

    Since Zotero stores PDFs inside the 'storage' folder which is located in the same folder where the database is, that's the only way I could figure out how to do this. Are you saying I should be doing this differently?

    Now that I'm using Zotfile, it allows me to set up a different folder to store my PDFs, so I guess the above is not an issue anymore. I'd still like to know what I'm doing wrong though.

    What I've done now is move the database into the default 'User's profile folder' (the path is '/home/gabriel/.zotero/zotero/8ebn317b.default/zotero/', don't really know how this is selected) This picks up my database just fine, but not my PDFs. So then I set up the relative links base folder where my PDFs are stored, but the PDFs are still not being found.

    I uploaded an image (in Spanish, sorry) so you can see how I've set things up: http://postimg.org/image/o16fj5j07/

    Any idea on how I should fix this?
  • Right, since you're using ZotFile now anyway, no reason to keep the database in Dropbox.

    The settings as you have them now are fine. You do need them set up on all computers, though, not just on one.
  • edited April 20, 2016
    I'll set the same settings in my desktop PC when I get home. The issue I have right now is that Zotero is not picking up any of the attached PDFs that are stored in the year-named folders by Zotfile in my laptop (where I made these changes right now).

    Is there any way to fix this automatically? Shouldn't the relative path for the base folder already take care of linking the PDFs properly?

    Finding the paths to each PDF one by one is not reasonable, since I have +800 PDFs.
  • Not sure in what sequence you did things, but would be good to check where Zotero is actually looking for your files. Moving the database shouln't have any effect on that. You can either look in your Zotero debug, or if that seems adventurous, in stall the Zutilo add-on, which will tell you:
    https://addons.mozilla.org/en-US/firefox/addon/zutilo-utility-for-zotero/
  • I installed the add-on and checked. Indeed it is looking somewhere else for the PDF attachment.

    How can I fix this for my entire database? The Zutilo add-on has an option to modify the path to an attachment, but I'm not sure how to use it.

    I'm also scared to do something that will mess up my ~900 entries.
  • Where is it looking, where do you want it to look?
  • For example, for a 2016 article it is looking here:

    /Zotero/almacenamiento/Zot//2016/name_of_attach.pdf

    (notice the double backlash, not sure why that happened?) That's the old path I use to have.

    The path to the base folder I've set up is:

    /media/rest/Dropbox/apps_sync/Zot

    so I want it to look here:

    /Zot/2016/name_of_attach.pdf

    All my attachments currently have paths that look like:

    /Zotero/almacenamiento/Zot//YEAR/name_of_attach.pdf

    and should be changed to :

    /Zot/YEAR/name_of_attach.pdf
  • I wonder if the double slash is preventing this.
    Try for one item (!) with Zutilo

    Modify attachment path
    and insert in the first window
    /Zotero/almacenamiento/Zot/
    press OK
    and insert in the second window
    /media/rest/Dropbox/apps_sync/Zot

    See if that works.
  • edited April 21, 2016
    Just tried (I checked 'Replace every instance of partial path' in the first window), it did not work.

    What happened is what I keep getting all morning, I explain below.

    Currently any old entry is shown by Zutilo with a path that looks like:

    attachments:../Zotero/almacenamiento/Zot//2015/name_of_attach.pdf

    I've tried adding a new entry to my database to see what the correct path is. Zutilo's feature "Show attachment path" for this new (properly stored entry) tells me it is:

    attachments:2016/name_of_attach.pdf

    (notice there are no double dots)

    Any modification I try on old entries (including your suggested one) results in a new path that looks like:

    attachments:..2016/name_of_attach.pdf

    So there's an issue here with the '..' that keeps being added to the path. Could the double backlash be at fault here?
  • In fact, nothing I put in the second window of the 'Modify attachment path' has any effect.

    This means that what I put in the first window, i.e.: the old path that should be replaced, is not correct.

    I've tried all modifications of the path:

    ../Zotero/almacenamiento/Zot//

    that I could think of. None so far worked.
  • and you've tried copying the path from Zutilo?
  • edited April 21, 2016
    I've tried the following paths to replace (i.e.: the first window that pops for Zutilo's 'Modify attachment path' option) using a fake path in the second window just to see if anything is changed:

    * ../Zotero/almacenamiento/Zot//
    * ../Zotero/almacenamiento/Zot/
    * /Zotero/almacenamiento/Zot//
    * /Zotero/almacenamiento/Zot/
    * /Zotero/almacenamiento/Zot
    * Zotero/almacenamiento/Zot

    None of these produce any change in the (incorrect) stored path, which sows as:

    attachments:..2016/name_of_attach.pdf

    while the correct one seems to be (according to a newly added entry):

    attachments:2016/name_of_attach.pdf
  • I think I've found the culprit.

    I changed in Zotfile's preferences the 'Use subfolder defined by' from

    /%y

    to

    %y

    and now changing with Zutilo the paths from:

    ../Zotero/almacenamiento/Zot//

    to nothing (ie: blank) works.

    Thank you very much for your patience Adam!
  • I have a similar problem but cannot seem to fix it with the steps above and I have also read this thread: https://forums.zotero.org/discussion/55466/zotfile-dropbox-zotero/#Item_0

    I am using Zotero (4.0.28.7) across two devices (PC and Mac). I have Zotero standalone on both and the base directory syncing via Zotero storage while I use Zotfile to sync attachments in Dropbox.

    I can rename files on each device and thus move them to the dropbox folder I created. However, every time I attempt to access a file saved by the other device I get the notification "The attached file could not be found".

    The Zotfile settings are:
    PC: Users\<name1>\Dropbox\Zotero\Zotfile
    Mac: Users\<name2>\Dropbox\Zotero\Zotfile

    Name1 and name2 differ due to company policy. As far as I can see, the reason is that Zotero, on each device, searches for the file in the 'normal' Zotero storage folder in the data directory (on PC: ...\Profiles\<random string>\zotero\storage). Meanwhile, I do not know how to change the settings.

    Thank you for your help!
  • How do you tell that Zotero is looking in the storage directory? It shouldn't, if you use ZotFile to move files.

    In Zotero, do you use a relative file base directory (that's a Zotero preference under advanced --> Files and Folder). Should be
    PC: Users\<name1>\Dropbox\Zotero
    Mac: Users\<name2>\Dropbox\Zotero

    respectively
  • Dear Adam,
    Thank you for for your help! It works now; I had Users\<name>\Dropbox\Zotero\Zotfile in the relative file base directory.

    As to why I thought Zotero would be looking in the storage directory: When I clicked 'locate' in the error notice, it took me directly there.
  • Ah, I think locate may take you to the storage folder when it has no idea where it should be looking. Not sure, actually, why this started working for you. Adding Zotfile in both places shouldn't have made a differences, so might be something else.
  • Interesting. Either way, thank you for your help.
Sign In or Register to comment.