# Prevent Jabref from auto renaming and moving files

**URL:** <https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596>\
**Category:** Help\
**Created:** [March 9, 2021, 3:19am UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596 "2021-03-09T03:19:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lafflecookie](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lafflecookie](https://discourse.jabref.org/u/lafflecookie)\
**Post date:** [March 9, 2021, 3:19am UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/1 "2021-03-09T03:19:39Z")

</div>

Hello, the previous version of jabref I used was 2.9.2. In that version, I could easily name my files, place them in a pdf folder, drag and drop it onto an entry in Jabref and it will happily link the file without being ‘too smart’.

In 5.2 however, jabref renames the file, moves it to .bib folder (which I absolutely do not want it to). How can I disable this functionality? All I want is for it to link a relative path and not do anything else.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [March 9, 2021, 1:41pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/2 "2021-03-09T13:41:47Z")

</div>

Hi,  
we switched to the modifier keys for drag and drop, see the help

> **[Entry Editor](https://docs.jabref.org/advanced/entryeditor#drag-and-drop-behavior-settings)**

---

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [October 25, 2021, 10:57pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/3 "2021-10-25T22:57:31Z")

</div>

Should be the path relative from the bib file or relative from a certain directory? If the latter is the case, one could change the main directory path in the JabRef Preferences: External Files.

If the path should be relative to the bib file, please set “.” as the “General file directory” at the “Library properties”

 ![grafik](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/9/9c89acf0d6ab8adbab3ae15d41165381820efb4d.png)

Then, please use the “Alt” key when dragging and dropping (at least on Windows)

---

<div class="post-metadata">

**Author:** ![astronomertom](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@astronomertom](https://discourse.jabref.org/u/astronomertom)\
**Post date:** [February 28, 2024, 3:06am UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/4 "2024-02-28T03:06:07Z")

</div>

Did you ever get this to work the way you needed?

I’m also having this issue and it looks like both the answers I see here miss the point of your question - that you DON’T want JabRef moving/copying and renaming your document files.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [February 28, 2024, 5:19pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/5 "2024-02-28T17:19:48Z")

</div>

@astronomertom So you would like to have a switch to keep original file names?

---

<div class="post-metadata">

**Author:** ![astronomertom](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@astronomertom](https://discourse.jabref.org/u/astronomertom)\
**Post date:** [February 28, 2024, 5:49pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/6 "2024-02-28T17:49:10Z")

</div>

Some kind of method to prevent it from moving/renaming files is vital. This is similar to the problem that made me drop BibDesk and Macs where the actual file location and the bibliography path to it was not reliable for importing into 3-d party software.

I’m at close to 12,000 entries in my JabRef Bib file, my area of work interlinking _many_ topics so splitting them up is impractical. Many of these papers have very similar titles, or are parts of threads in discussion sections from physics magazines. With this technique, they _all_ want to be in the same directory making it unusable.

Plus from a provenance perspective - ANY alteration of your source document can be a problem. A processing hiccup or bug adding metadata to a PDF could render it unusable and difficult to replace. Not everything is preserved on [archive.org](http://archive.org).

Thanks for your attention,  
Tom

---

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [February 28, 2024, 9:28pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/7 "2024-02-28T21:28:07Z")

</div>

Some comment on this one:

> [@astronomertom](#):
>
> Plus from a provenance perspective - ANY alteration of your source document can be a problem. A processing hiccup or bug adding metadata to a PDF could render it unusable and difficult to replace

Altering **content** of PDF files is always an action triggered by user explicitly. JabRef does **not** automatically do some “magic” change of the PDF contents.

The discussion here is only about file names. That users want to keep their filenames and not have JabRef generating “nice” filen ames.

---

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [February 28, 2024, 9:44pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/8 "2024-02-28T21:44:05Z")

</div>

3.8.2, the dialog renders as follows:

![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/f/f7cd11202dc9f7cc266ac56bb25fc0fd71982e54.png)

Offers two modes:

1. Create new entry based on PDF
2. Attach PDF

Drawback: Does not ask for renaming - and somehow confusing.

Currently, JabRef also allows to create a NEW entry based on the PDF by dropping **between** an entry in the main table:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/f/f233fbec8715b6c10eb271fd619ccf0b8ae51c7e.png)

---

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [February 28, 2024, 10:11pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/9 "2024-02-28T22:11:39Z")

</div>

Note that we had a preference for it: [Link file (without copying) doesn't work · Issue #5546 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/5546)

A long discussion was made at [Dropping a PDF on an entry should be consistent · Issue #121 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/121)

The dialog was as follows

 ![5d97be1a-130e-11e7-9ba5-fdd9037e3f3a](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/0/0175f07503214d715dd75777ca57aabf96d5b2b1.png)

* * *

We want to have “Remember decision”, thus we will re-add a preference.

Notes on the dialog:

- Outputting the file directory is nice, because it makes explicit, where the file will be placed
- “Copy to file directory” is a nice setting if one copies from a shared network folder. However, “move” should be default and “Copy” is only a secondary choice
- “Leave file in its current directory” is incomplete. It should be “Link the file”
- File renaming activation and showing the new file name is nice

### New Proposal

How would you like to treat the file ‘{file name}’ residing in {directory}?

- Link file
- Move file
- Copy file

(radio group)

* * *

Target directory is: {file directory}

- Rename file to {new file name}

(This part is only enabled if move or copy is selected)

* * *

#### Notes

- are the defaults to the radio group
- If file already resides inside a file directory, then “Link file” is the only enabled option AND “Rename file to” can be selected (because as user, I want to keep the file in the folder hierarchy of files). “a file directory” means that one JabRef’s file directories (global file directory, main file directory, user-specific file directory). – Let’s call this “Mode inside-bib-directory”
- org.jabref.model.database.BibDatabaseContext#getFirstExistingFileDir returns the target directory.
- org.jabref.model.entry.LinkedFile#findIn(java.util.List\<java.nio.file.Path\>) can be used to check if the file resides inside a directory (to switch the mode to “inside-bib-directory”)

---

<div class="post-metadata">

**Author:** ![astronomertom](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@astronomertom](https://discourse.jabref.org/u/astronomertom)\
**Post date:** [February 29, 2024, 1:55pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/10 "2024-02-29T13:55:24Z")

</div>

This looks promising.  
But are you saying this was an option of linking to the file (without moving or renaming) that is actually available, but not clearly specified?

Tom

---

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [March 5, 2024, 11:32am UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/11 "2024-03-05T11:32:35Z")

</div>

> [@astronomertom](#):
>
> But are you saying this was an option of linking to the file (without moving or renaming) that is actually available, but not clearly specified?

I don’t know, what you mean by “specified”.

On Windows, you need to hold down the Alt key to link a file (without renaming). Similar to the Windows Explorer shortcuts.

I don’t know if this works on Linux or MacOS.
