How to rescue my links?

I’ve been starting to restructure my Vault and (foolishly?) thought it would be easier to move files to their new homes in Windows File Explorer rather than in Obsidian itself.

I’d done about 50 when I realised that many of them contained images which are in the _resources folder. All these links are broken, presumably because the new folders are at a different level from the old ones. I know now I’ll have to do all further moving within Obsidian to preserve the links but is there anything I can do, either globally or within the individual notes to recover the situation for the ones I’ve moved?

Things I have tried

I’ve tried changing the …/…/ paths in the links but whenever I do this I get a message when I click it in Reading Mode saying Folder Already Exists.

I’ve found so far that I can rescue individual images and PDFs in notes by editing the link to remove the path completely, just leaving

  • exclamation mark
  • open square brackets twice
  • filename
  • close square brackets twice

Is this the best way?

If you were previously using relative link paths, and if all of your files are uniquely named, then yes, this’ll work.

Are there a lot of fixes? If it’s many many many, it might be worth learning a bit about regular expressions (“regex”) and using VS Code’s mass find-and-replace tool to fix it all at once. However, this wouldn’t be trivial if you’re new to regex.

Thanks. I’ve just estimated the time it’ll take to do it this way (changing the file paths) against restoring the originals and moving them again to their new destinations but inside Obsidian. I think the first way will be better. Maybe at some point it’ll be worth spending some time learning regular expressions but probably not now. I’ll just get the damage undone. With hindsight it was obviously a lazy and daft way to move them.

1 Like

UPDATE I’ve found the community plugin Regex Find and Replace which is making the whole operation a lot quicker!

1 Like

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