When moving files through Drag and Drop, Obsidian quietly drop the source files in an arbitrary location when similar folder found in the destination losing the first directory. The usual folder moving behaviour (to add a 1, 2 etc to the source directory’s suffix if a duplicate directory found in the destination) is not working in this scenario.
Steps to reproduce
- Open the Sandbox Vault (Help > Open Sandbox Vault
- Delete all the existing folders (Right click on each folder > delete) to clear the vault so that it is distraction free for us to re-produce this issue.
- Create the file/folder structure and content as follows:
File | Content | |
---|---|---|
3.1. | Proj 0.0/Dir1/SubDir/File1.md | Dir1_File1 |
3.2. | Proj 0.0/Dir1/SubDir/File2.md | Dir1_File2 |
3.3. | Proj 0.0/Dir2/SubDir/File1.md | Dir2_File1 |
Here’s a script if you are Linux/Mac and would like to do this in one go.
As you can see just changing the dir1 and dir2 will help you generate as many test scenarios as you like for testing. You may notice the first and second directory naming doesn’t cause any issues.
# Test 1 - Successful
# dir1="Dir1/SubDir"
# dir2="Dir2/SubDir"
# Test 2 - Success
# dir1="Proj 00/Dir1/SubDir"
# dir2="Proj 00/Dir2/SubDir"
# Test 3 - Failed
dir1="Proj 0.0/Dir1/SubDir"
dir2="Proj 0.0/Dir2/SubDir"
mkdir -p "$dir1"; echo Dir1_File1 > "$dir1/File1.md"
mkdir -p "$dir1"; echo Dir1_File2 > "$dir1/File2.md"
mkdir -p "$dir2"; echo Dir2_File1 > "$dir2/File1.md"
Now your vault should look like this:
- Now drag the sub-directory
SubDir
folder from the directoryDir1
and drop into the directoryDir2
using your mouse or track-pad.
Did you follow the troubleshooting guide? [Y]
Expected result
Notice the directory SubDir
that was already-existing was renamed to SubDir 1
without losing its destination.
Actual result
Arbirary folders were created (Note Proj 0
) and moved files were placed there. Old sub-directory is now completely lost. File content found to be present. In a large vault this is going to now be a nightmare.
Environment
SYSTEM INFO:
Obsidian version: v1.5.12
Installer version: v1.4.13
Operating system: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 23.5.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0
RECOMMENDATIONS:
none
Additional information
It is the dot (.
) in the folder name that cause the issue. Workaround may be to replace that with an underscore (_
) perhaps if that’s possible for the use of the vault. In my personal case, project ID is my prefix of the folder, and they have the dot thus maintaining the order. So, if this can be fixed, I’d be super grateful.