What I’m trying to do
I somehow copied my vault inside my vault.
cd MYVAULTNAME
tree -L 1
and the result:
├── MYVAULTNAME
│ ├── file.PDF
│ ├── ... etc ...
The vault seems like a mostly identical copy. If I have to guess how this happened, I probably copied the vault at some point, or used Obsidian’s menu to “sync a new vault” inside the already existing vault. Another mistake I did was having iCloud sync enabled on this vault on one of my computers. (I think the default location of ~/Documents for Obsidian on MacOS is a mistake, since default MacOS syncs that folder to iCloud drive…). Regardless, let’s fix this!
Few things:
- It’s relatively big with 631 files hence I don’t feel like I could resolve this manually.
- I don’t know when this happened, may have been 1-2 years ago
- When I noticed it, I tried editing only the root vault’s contents - although I may have inadvertendly edited some of the duplicate vault’s contents
- This is synced in Obsidian Sync, so it’s the latest source of truth
Things I have tried
- Nothing
Here are some ideas:
-
write a script that compares files from the root and the copy, including latest modified date - take only the latest modified one. One big con here is that it can result in data loss - e.g if original note A was modified in May 2024, but the copy was modified in March 2024 – the strict would only take the original one which wouldn’t include the copy’s changes
-
write a script that compares files from the root and the copy, including latest modified date - flag the ones that are inconsistent, then manually resolve it. This is doable, as I don’t imagine I edited more than 50 of the 631 files
-
use some pre-made tool for somebody else that hit this problem. This is my preferred solution and the reason why I’m posting here. Hopefully someone can help