My “Quick and Dirty Way” to copy a file and/with/including all it’s attachments/images to another vault.
use the dataview plugin
paste the dataview snipped below into the file you want to copy over to another vault
copy the dataview output to the clipboard
remove the pasted dataview code of step 2 from the file
in a terminal shell cd your vault’s base folder
create the subfolders needed below <basePathOfOtherVault>
cp <pasteHere> <basePathOfOtherVault>
LIST WITHOUT ID join(list("\"",
join(list(
string(file.path),
join(map(file.outlinks, (x) => meta(x).path), "\" \"")
), "\" \""),
"\""), "")
WHERE file.path = this.file.path
rendered dataview result is a list with one(!) element:
first the quoted file path/name.md of the file you want to copy,
and then quoted file path/names of all attachments, e.g.:
Yes, you are right.
One would keep one’s vault consistent by using the plugin and then just use the underlying file system of the OS to copy & paste it over.
I personally haven’t had to use the plugin because I keep my vault such that I can easily open it in e.g. Markor Android app or Windows/Linux VS Code.
A couple of users have found it useful to be able to view their “lost” attachments.
Perhaps that is the strength of your method … one does not have to have ““Default location for new attachments”:In subfolder under current folder.” to copy files over to another vault.
just out of curiosity: what are the advantages of Markor on Android vs the obsidian app on Android, so that you’ve chosen to use Markor over obsidian Android app?
I use the Markor Android app and its QuickNote for quick entry without having to open Obsidian or when due to low RAM it has dropped out of memory & relaunching the app+plugins+workspaces is not needed & would take too long. I also like using Markor & VS Code to check that my notes are usable outside of Obsidian.
My Markor settings make it access my Obsidian vault files location:
If support for moving files between vaults is added, I think the attachments shouldn’t always be copied. IMO attachments should be copied to the new vault(s) when there are still files in the original vault that reference the attachment, and moved to the new vaults(s) and deleted from the original vault when there are no references to it.
I don’t understand why this isn’t just “built into” Obsidian itself.
I feel like if I have two vaults open on the screen at once, I should be able to copy files or folders from one vault to another by just “dragging and dropping” them from one window’s navigation pane, to the other window’s navigation pane, and move files by holding down the ⌘ key while releasing the mouse over the target (i.e. the same way Finder works).
It’s not a show-stopper for me to have to use Finder (or the command line) to copy/move the underlying files from one vault’s directory into the other, but it is still a bit of a mental interruption to have to think about it at all.
Maybe I’m just spoiled by having been a Mac user since OS/X 10.2 …
I think this topic needs to be tagged with feature requests. This is such an essential feature for those with multiple vaults organizing data at any point of time.
It must also be easier to choose multiple files at once at random. (Currently, multiple files can be selected linearly by holding Shift key unlike how we use Ctrl where we have true freedom to choose what we want).
I think this should be possible to implement since Obsidian wil be a .md file editor outside of vault.