Zotero creating duplicate PDFs upon file name change
Hello,
Whilst researching why my library was as big as it is, to see if I can do anything to reduce its size, I noticed that many PDF files (in the `../storage/*` folders were doubled up.
In each instance the PDF has one copy with a cryptic name, and another with a name that matches the title of the document in question.
I am guessing this occurs when I rename the PDF (in Zotero) to have a more meaningful name. E.g. One instance has a name like "F041-CATest1977.pdf" and then the other instance has a name like "Marino - Biological Effects of Extremelrv Low Frequency Electric and.pdf".
I am not sure at one stage in my interaction with the idem in Zotero this filename change occurs. Obviously, the PDF attachment always just shows "PDF" as its name in Zotero.
[[UPDATE: I gather it's the "Filed Renaming" settings that are behind the renaming of the files.
https://s3.amazonaws.com/zotero.org/images/forums/u375021/2fjmvjvlx0ywineftilz.jpg
Although I see no option to have Z delete or not delete the original file ]]
So I have three questions:
1. What is causing the filename to change? (something I am okay with, but would like to understand the cause of). Is it when I update the library item title? I suspect it is, because the file name ends up reflecting what I put in the title. Although in the above example I see the filename also ended up with a prefix of the author's surname (which is not something I added to the title of the library item).
2. Why does it leave the original copy there? This results in a lot of duplicate PDFs and therefore unnecessarily bloats my library storage.
3. Something else I notice is that if I add a new PDF to a library item, and delete the old one (typically named "PDF"), the old file remains in the storage folder for that library item, and the new one ends up in a new storage folder. As the old PDF is no longer associated with (attached to) a library item, why is it not deleted from the drive?
Regards,
Jonathan
Whilst researching why my library was as big as it is, to see if I can do anything to reduce its size, I noticed that many PDF files (in the `../storage/*` folders were doubled up.
In each instance the PDF has one copy with a cryptic name, and another with a name that matches the title of the document in question.
I am guessing this occurs when I rename the PDF (in Zotero) to have a more meaningful name. E.g. One instance has a name like "F041-CATest1977.pdf" and then the other instance has a name like "Marino - Biological Effects of Extremelrv Low Frequency Electric and.pdf".
I am not sure at one stage in my interaction with the idem in Zotero this filename change occurs. Obviously, the PDF attachment always just shows "PDF" as its name in Zotero.
[[UPDATE: I gather it's the "Filed Renaming" settings that are behind the renaming of the files.
https://s3.amazonaws.com/zotero.org/images/forums/u375021/2fjmvjvlx0ywineftilz.jpg
Although I see no option to have Z delete or not delete the original file ]]
So I have three questions:
1. What is causing the filename to change? (something I am okay with, but would like to understand the cause of). Is it when I update the library item title? I suspect it is, because the file name ends up reflecting what I put in the title. Although in the above example I see the filename also ended up with a prefix of the author's surname (which is not something I added to the title of the library item).
2. Why does it leave the original copy there? This results in a lot of duplicate PDFs and therefore unnecessarily bloats my library storage.
3. Something else I notice is that if I add a new PDF to a library item, and delete the old one (typically named "PDF"), the old file remains in the storage folder for that library item, and the new one ends up in a new storage folder. As the old PDF is no longer associated with (attached to) a library item, why is it not deleted from the drive?
Regards,
Jonathan
It seems to be Zotero has relatively poor file handling protocols, potentially resulting in a significant amount of excess storage space being used for redundant files. Is this something being actively addressed in the development plan?
2.1. Yes, I am seeing this within a single 'storage' folder. My storage folder is not in the default location.
2.2. It is in: '~/Documents/@Application Datastore/Zotero'
2.3. I have not yet identified the steps to cause this outcome. But will do some tests to try and see if I can make it happen.
3. My mistake. I forgot that Zotero has a Trash system.
4. Sure. No problem. I didn't realise expressing an opinion based on my direct experience (however unique) would be an issue. In retrospect, I can see how some people may take it as a unjustified criticism and feel a reaction to that. I will avoid making such comments in the future.
Thanks.
But you also have lots of plugins installed, including multiple that involve moving/renaming files, so that's the most likely cause here.
If you can reproduce this in Troubleshooting Mode (Help → "Restart in Troubleshooting Mode…”), which disables all plugins, we'd want to see a Debug ID for it occurring, but it's very unlikely that this is caused by Zotero itself.
https://s3.amazonaws.com/zotero.org/images/forums/u375021/kgsti0hsrlp3crq10ppe.jpg
Yes, there are a number of plugins installed. As far as I can tell, the main one that involves file manipulation is ZotMove. However, it's never been configured, so has been non-operational. I have now disabled it, since I wasn't making use of it.
I suppose it's possible Zotero Linter plugin might rename files, although I don't see that anywhere in its settings or description online. AFAIK, it only makes changes to metadata and titles etc. within Zotero.
As the renamed files exactly follow the naming convention in the "File Renaming" settings of Zotero, I am inclined to think that's what did the renaming. Although, obviously that's coded to only rename the existing file, not to first duplicate it. So it seems to me it's not a question of what did the renaming, but what caused a second file (with the original file name) to be created along side the renamed file.
https://s3.amazonaws.com/zotero.org/images/forums/u375021/jz2kzw3aktd470aw05fx.jpg
>> UPDATE
I was able to recreate the issue (with plugins enabled), and not without them enabled. I then found the issue went away when I disabled Zotero PDF Metadata plugin (https://github.com/franzbischoff/zotero-pdf-metadata/). Oddly, when I re-enabled that plugin the issue has not returned.
So for now it appears the issue has been resolved, although I am not sure why disabling and re-enabling that plug-in did the trick. Thanks for your help in pointing out the various troubleshooting features in Zotero, and other suggestions. This enabled me to figure out what was causing the problem.