How to make a vault like obsidian sandbox that doesn't save any change

I like the fact I can experiment with The Sandbox Vault knowing none of the changes will save, and the next time I will open it, I know it is exactly the same as it was. Now I downloaded another vault, and I want to experiment inside it, but I want this vault to act like The Sandbox Vault, and never save any change. How can I do that?

Make copies of it and edit away in one.

If you download two copies of it, you can keep one as the original copy, and the other as the working copy. Open only the last one as a vault within Obsidian, and whenever you feel to reset it erase the copy and copy in the original.

@Yurcee @holroy thanx but I knew how to backup files and make a copies :sweat_smile:
I actually need to replicate Sandbox behavior.

Both of us informed you on the method that works as replicating Sandbox behaviour is impossible on custom/user vaults.

There are ways with git if you upload the vault as a repo to your own GitHub. But you’d need to discard all changes manually (GitHub Desktop or terminal way).

why it’s impossible?

:slight_smile:
Well not because I say so. :slight_smile:
Because Sandbox is an integral part of Obsidian? Obsidian devs programmed it that way?

I guessed that there is some kind of code that uses some source vault to create Sandbox Vault folder every time I click to open the Sandbox. If my guess is true there might be some way to add some folders and files inside the source vault. things like that…

Well, let’s find out together.
I’m on it!

If you look into the Obsidian obfuscated code, you will see how the Sandbox works

  1. They have a snapshot of Sandbox vault.
  2. Every time you open Sandbox vault, the corresponding directory is emptied and the content is restored from the snapshot.

So there is nothing special inside the Sandbox vault itself, it’s an usual vault. Obsidian program is restoring it from the snapshot. Sandbox vault itself doesn’t have this restoration logic.

2 Likes

I know! I deleted Sandbox folder inside windows file explorer, and I observed that if I click to open Sandbox, Obsidian Creates that folder out of nowhere! But how? Does it use any template file to create that folder? if yes, which one? can I change that reference file?

The sandbox template folder is embedded inside obsidian.asar

If you are on Windows it’s C:\Users\[UserName]\AppData\Roaming\obsidian\obsidian-[version].asar

You can validate it via unpacking npx @electron/asar extract "C:\Users\[UserName]\AppData\Roaming\obsidian\obsidian-[version].asar" obsidian-asar-unpacked

Technically you can unpack it, modify it and pack it back
But this would work only until the next version update

1 Like

Thank you @mnaoumov :pray:. It works.

for those who want to edit the .asar file, this video shows them how : how to edit .asar files

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