I work with one vault, but I want to copy one of its folders (with attachments and subfolders) into an independly working vault to a different drive (a USB stick). No files are linking from and to files in this folder. But sure, some files in this folder are linked to/from other files in that folder.
It may be, that this structure is getting it’s own vault or that it is copied into an other subfolder of a already existing vault.
Will this work as easy as described or do I overlook something?
In theory a vault is just a bunch of normal text files, so any copy operation should suffice to make it into another vault.
When I say in theory, it’s related to the fact that it’s true for the content of the vault, but if you just copy the files and folders themselves then you don’t copy any of the metadata which Obsidian and plugins needs to function. This is however, not a very big issue, as after you’ve opened the new vault and installed the wanted plugins, it rebuilds this metadata and cache and so on almost immediately.
There is of course also the caveat you’ve mentioned yourself, that if any of your files links to something outside of what you’ve copied, these will now be unresolved links in the new vault.
A few further questions and thoughts for that I’m begging for your comments.
What will happen, when an already existing attachment has the same name in my given folder and the destination folder? Does obsidian save all paths to all files and attachments in a database to prevent such conflict situations?
the probably unique path to exclude unwanted results.
Same tags in the destination vault would mix with the new added folder, so I have to make them unique, when I want to avoid this.
When I later give an update of my structure it may be, that the at first provided files have changed it’s content, names, tags, yaml, positions on the destination in the meantime. Is it possible to make the files read-only and copy them with this attribute to the destination folder? So I can be sure, that the second copy doesn’t overwrite something. The at first given folder has to be deleted, first.
If you follow the steps above and either A) clone the vault and rename it or B) make an empty new vault and copy over what you want, there won’t be any conflicts.
If you decide to make a new vault (B above) and only copy over selected folders/files, there may be some unresolved links. Custom queries will need to be re-done if they reference files/folders you haven’t copied over, etc.
From that initial point on, think of the two vaults as silos on their own, completely separated and moving apart with every change you make.
As holroy said, a vault is just a bunch of folders and files, so you could always make a copy, name it VaultA-2023-03-24-1130, zip it up, and keep snapshots. Lots of software can automate this. If you do decide later to merge vaults A & B for whatever reason, things could be tricky, for sure.