Working with Sync and a "disappearing" vault

What I’m trying to do

I’m trying to develop a workflow to work with a vault that is:

  • Located in a directory that may not be available
  • Is synced via Obsidian Sync

My vault is located inside an encrypted mount point, which I need to manually mount. My problem is that Obsidian saves the last opened vaults and reopens them.
If it tries that while the directory is not mounted sync kicks in and sends “delete” events for every file inside the vault.

I’m currently thinking about multiple things:

Where does Sync store its config?

It can’t be inside the vault or it wouldn’t start syncing without the vault present. If I can change the sync config when mounting the directory I could stop the sync from happening when the directory is unmounted, that would solve the “delete everything” problem.

Can I prevent sync from running from inside the vault?

If I can place some “pseudo” vault in the directory that contains just enough config to prevent sync from running I could just close the window, mount the directory and reopen the vault when I need it.

Can I run a second instance of Obsidian?

If I could point obsidian at a different global config folder it wouldn’t even know about the problematic vault. If I put the config inside the directory the setup would be completely self-contained.

TLDR: I’m seeking a way to reliably use Obsidian with a vault that’s only accessible through an encrypted volume that is only manully mounted on demand, preventing accidental data synchronization during the unmounted state.

If I had this problem, I would make a little script that checks if the drive is mounted and if so launches Obsidian, otherwise pops a notification or starts the mount process. Then when I wanted to launch Obsidian I would launch the script instead of doing it directly.

Sync settings are stored in a system folder: https://help.obsidian.md/data-storage#Global+settings.

Thanks for the suggestion. The thing is I don’t always want to open the “hidden” vault. Most of the time I just work in my other vault. But since I can’t control which vaults get auto-opened I’m kinda back to square one.

The very obvious answer is being extremely disciplined with opening and closing vaults but thats something I am not good at.

Hence the search for a workaround

Regarding the sync settings: I’ve found the global config folder but can’t find a specific sync settings file. I suspect its inside one of the sqlite databases, but that’s pure guesswork

I wouldn’t expect anyone to be.

If you don’t mind always starting in the same vault, you could make a launcher for an Obsidian URI and use that instead of the app launcher. Or you could set one up for each of your vaults, perhaps except the one that requires the mount (for that one you could follow my earlier suggestion).

Sounds likely.

1 Like

That’s a very usable workaround. Implemented that for now.

I think I’ll write up a feature request for the sync plugin to check if the vault is present before starting the sync.

There’s a slightly-related FR here:

Yeah, similar situation but subtly different. I included it in my FR - thanks for pointing it out. There seem to be a few people who try to use a workflow with vaults in “non-standard” places.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.