Hi,
I know this topic has been discussed in past. But I dont find any good solution I am looking for. My all attachments reside in ‘attachments’ folder.
I want to transfer a bunch of notes from one vault to another. I know I can just copy the files, but I still need to look for specific attachments which are linked inside those notes. Anybody knows how to do this elegantly in 2025, please help.
Can there be an option to create a separate Vault altogether, from the selected notes/folders from within Obsidian.
I think the most complex part may be figuring out the file names and paths to copy. Once you have a list of those file names and paths, the task of copying them can be easily automated with Python or another scripting language. For the part of extracting the file names, it occurs to me that you can use Bases in the following way:
Decide on a feature that all the notes you want to export have in common. For example, they’re all inside the same folder, or they all share a certain tag in the frontmatter.
Create a Bases table that lists all the notes matching that criterion, and for each note (using a formula I’ll detail below), generate a list of all attachments it links to, showing the full path of each one.
Verify that the table shows exactly what you need.
Export the table as CSV (by clicking the number of results shown in the table header).
After step 4, you can write a script (in Python for example), that processes this CSV and copies each of the mentioned files. For the notes to work correctly in Obsidian, the destination vault where you copy them should have the same folder structure as the original vault (at least for the attachments).
Example
If the search criterion is that the notes have the tag exported, the following Bases table does exactly that:
The resulting table shows in the first column the relative path of each selected note, and in the second column the list of attachments, each with its path relative to the vault root. In the exported CSV, columns are tab separated, and attachments are comma separated inside its column.
A solution might be to just go ahead and copy the folders/files, and the attachments folder, into the new Vault. Don’t look for specific attachments linked to any of the notes. Don’t bother. Since we can just have a copy of the attachments folder in each Vault, just do that. The result will be excess, unlinked attachments in the new Vault, but at least you’ll have the ones you want. Does that make sense as a solution for you? Or did I fail to understand the question.