Whats the best way to transfer notes from one vault to another. Along with attachments. Without 3rd party plugin

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.

Thanks

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:

  1. 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.
  2. 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.
  3. Verify that the table shows exactly what you need.
  4. Export the table as CSV (by clicking the number of results shown in the table header).

The formula mentioned in step 2 is:

file.links.filter(value.asFile().ext!="md").map(value.asFile().path)

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:

formulas:
  attachments: file.links.filter(value.asFile().ext!="md").map(value.asFile().path)
views:
  - type: table
    name: Table
    filters:
      and:
        - file.tags.contains("exported")
    order:
      - file.path
      - formula.attachments

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.

For example:

file path attachments
Classes/Calendars/2025-2026.md Attachments/2025-Schedule-3º.pdf, Classes/Calendars/Plan.canvas, Attachments/2025-Calendar-Univ.pdf, Attachments/2025-Schedule-4º.pdf
People/Roxana.md People/Photos/Roxana.png
1 Like

Thanks for the proposed solution.
But it seems too much for something so basic.

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.

Well, it’s not a bad idea, Ninsuhn.
Then OP can use the following

to tidy up what is not needed in other vault.

But still a lot of work. I believe there was a plugin for this, Attachment Manager or somethin.

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