Filenames of all linked PDFs changed and now the links are broken

I'm using Zotfile to rename and save linked PDFs in a custom folder that I can sync with Google Drive.

I think I messed something up in Zotero a couple of days ago, because the filename of all of my 250 linked PDFs changed. Zotero however still looks for the file with the original name, so now the links for all of the files in my entire library are broken.

I'm pretty sure the problem happened when (for the first time ever since using Zotero) I exported my library. I did this so I could remove the "Note" field of the BibTex with JabRef and then use the bibtex in Overleaf and not have the "Note" field show up in the bibliography. I can see in Google Drive that the filenames of the PDFs all changed at the exact same time, around the time where I was working on exporting the BibTex. Also, the filenames changed to include the citation tag of the BibTex. Example:

Old filename: Pei et al_2020_Morphological and Spectroscopic Characterizations of Monolayer and Few-Layer2.pdf

New filename: pei_morphological_2020-6 - Morphological and Spectroscopic Characterizations of Monolayer and Few Layer MoS2 and WSe2 Nanosheets under Oxygen Plasma Treatment with Different Excitation Power_ Implications for Modulating Electronic Properties.pdf

In the exported bibtex, for some reasons there are six entries for this source, hence the "6" behind the author and date in the filename. The bibtex citation handle is "pei_morphological_2020-6". So the renaming format is something like: {bibtex handle} - {full title} instead of the old {Author et al}_{Year}_{short title}. Also note the - in "Few-layer" that is not present in the new filename, i.e. this is not a straightforward reordering of fields.

I used Zutilo to check the attachment path of the file in Zotero, and it's still set to the old filename, hence the link doesn't work even though the files themselves are still all there, just with a different name.

Is there anyway I could fix this? I know about the Zutilo "modify attachment path", but judging from the Zutilo docs this will only change the path of the file (which is unchanged) and not the name of the file in the attachment path itself.

I guess that either I would have to 1) figure out the new name formatting and in Zotero batch rename the filenames in the attachment links for all entries (if this is possible at all), or 2) figure out a way to batch rename the filenames of the pdfs themselves to the old name format, maybe using third-party software (the software would have to be able to extract the author, year, and (short) title from the pdf itself).

I'd prefer not having to relink 250 pdfs manually ofcourse. Any suggestions? :)
  • I can't help you with this — I'll just note that this isn't anything that Zotero itself did, and it certainly wasn't from just doing an export, which obviously doesn't affect your existing data.
  • I'd check your Zotfile settings as the most likely culprit here. With file*names* changed, I really don't see an alternative to manually relinking, I'm afraid.

    (BTW, no need for the export to remove fields from bibtex. The BBT add-on can do that)
Sign In or Register to comment.