I am using RM 10 under Windows and here is my understanding of how relative paths work.
My sources are held in subfolders of
C:\Users\andy\Data-Med\Family history\Andrew\Sources
e.g.
C:\Users\andy\Data-Med\Family history\Andrew\Sources\Civil\BRT-03-0002 Catherine Graham
My RM settings specify
Media file: C:\Users\andy\Data-Med\Family history\Andrew\Sources
To add a media item to a source, I drag it from Windows Explorer to the source record.
If I rename both my source file and the RM settings (Media File) to
C:\Users\andy\Data-Med\Family history\Andrew\Sources-XXX
then RM continues to access the media item at its new location.
However, this only works if the RM settings (Media File) match the path of the source file at the time that the media item is added to the media library. Otherwise, RM is unable to establish the relative path.
If this is correct, then my problem is that I did not at first appreciate the need for condition (5). The RM settings specified the ‘default’ media file of
C:\Users\andy\Data-Med\Family history\Andrew\Rootsmagic
I could of course, delete all the media files and add them again with the new RM settings.I just wondered if there is any other way of implementing relative paths retrospectively. I suspect not.
I have no plans to move my source file but, if I did so, I assume that all the broken links can be fixed in the usual way.
RM does not feature any understanding of such a thing as relative paths. It features the ability to set (or not) a default folder to be opened and displayed to the user, when the Media facility is used to browse the file system. It then tracks and remembers the path you take (for later on in the process).
As far as media file paths are concerned, RM only understands and cares about the path to any particular media file …at the very moment of linking that item… so it can create a thumbnail of it and then store that, along with the full filename path (nothing relative) into the database and link (associate the two). Thereafter, any renaming or moving of the file, outside of RM’s media facility, is gonna result in that red X. From within, you can double-click any media item, then move it and/or rename it and finalize the new path or even choose a different item, but RM is looking to just match/link a filepath to a thumbnail. That’s the only requirement on You.
Beginning with RM8 and continuing with RM9 and RM10, RM does support relative paths for media files. In fact, it always stored media files via relative paths. There is not an option to turn relative paths on or off. They are always on. But the way it does it is a little trickier than it sounds and the RM user interface tends to present media to you as if the paths were not relative. But they really are relative behind the scenes.
That being said, I’m confused about your scenario. At one point, you said that your default RM media folder was
In general, your understanding of what you said for steps 1 through 4 is correct. Suppose you store your media files outside of RM into C:\Users\andy\Data-Med\Family history\Andrew\Sources and suppose you set the default media folder to the same folder. Suppose you then link one or two or hundreds of files from that folder into RM. So far, so good. Everything is fine and there are no broken media links. Then suppose you rename the Sources folder to Sources-XXX outside of RM and suppose you also change the default RM media folder to C:\Users\andy\Data-Med\Family history\Andrew\Sources-XXX as you describe, Everything should still be just fine. So it seems like it’s the introduction of C:\Users\andy\Data-Med\Family history\Andrew\Rootsmagic into the story which is breaking your links. Or I’m not understand your actual process correctly.
Thanks for confirming that my understanding is correct.
Sorry for any confusion.
My RM Media Folder is now set to match my ‘Windows’ source folder
C:\Users\andy\Data-Med\Family history\Andrew\Sources
so all works exactly as you describe.
PREVIOUSLY, I had left the RM Media Folder at its default value
C:\Users\andy\Data-Med\Family history\Andrew\Rootsmagic
which was different from my ‘Windows’ source folder.
This meant that any media files that I copied to the media library were permanently assigned the path as it existed ‘at that time’.
Although I have now changed the RM Media Folder to:
C:\Users\andy\Data-Med\Family history\Andrew\Sources
this has no effect on media items which had been stored in the Media Library before making the change.
My (relatively minor) problem is that I am stuck with this situation unless I delete them all and add them again.
Yes, that’s correct. And thanks for the clarification. Essentially, if there is a mismatch between where the file actually is and what the RM default media folder is at the time the file is linked into RM, then the file is linked into RM at that time using what is essentially an absolute file path.
However, I believe you can still fix all the old ones en masse. You can do a Search and Replace of MultiMedia filenames and replace C:\Users\andy\Data-Med\Family history\Andrew\RootsMagic with C:\Users\andy\Data-Med\Family history\Andrew\Sources
I confess I haven’t tested this in RM8/9/10. It would have worked fine in RM7. In RM8/9/10, it should have the effect of converting your media links that were entered accidentally with an absolute file path into a correct and relative file path. Well, Search and Replace certainly still works in RM8/9/10. But since I have not tested it under these exact circumstances, I’m not 100% sure what happens when absolute and relative file paths intersect in this manner.
One other minor point: when I said that when a file that is not in somewhere in the default RM folder is linked into RM that it is linked into RM using what is essentially an absolute file path, that was a slight oversimplification. Under these circumstances, RM then tries to link the file into RM using a relative file path that is relative to your Documents folder. I don’t know how it works on a Mac, but on Windows these days the location of your Documents folder is a settable Windows option so RM follows the Windows option. Only if that also fails because of where your file is really located does RM actually link your file into RM with an absolute file path.
This little exchange may have solved a little mystery that has been bothering me for a long time. Namely, this same issue seems to come up over and over again. Sometimes when I offer this same basic advice to users, it works fine and sometimes it doesn’t. So as a last gasp fallback, they will run the Fix All Broken Links tool and all will be well. What hadn’t occurred to me is that sometimes the user may have linked some media files into RM before setting the media file option. Then they changed the media file both in RM and in Windows and had some broken files. I couldn’t figure out why. I had assumed that they had set the media file option before linking in any files, and that was probably a false assumption on my part. So thanks for solving the mystery.
I looked into the Search and Replace, but not sure how it applies in this case.
All the ‘old’ media files are displayed with file names such as
C:\Users\andy\Data-Med\Family history\Andrew\Sources\Civil\BRT-02-0001C Margaret Patterson.jpg
which corresponds to the path when the file was first added to the media library. RM regards this as the absolute path which is OK as the file is still in the same physical folder.
All the ‘new’ media files are displayed with names with the same structure such as
C:\Users\andy\Data-Med\Family history\Andrew\Sources\Civil\BRT-03-0002 Catherine Graham.jpg
In this case, although it appears to be an absolute path, I assume that it was constructed by RM from variables in the background, concatenating the value of the RM Media folder and the final elements of the file name.
Thanks again and I will let you now if I find a straightforward way of converting the old media files to the relative path format - but I am not optimistic!
Under those circumstances, how can you tell which ones are new with relative paths and which ones are old with absolute paths just by looking at the file paths in the RM user interface? Or have you looked in the RM database directly using SQLite?
Correct. I cannot tell just by looking at the path names as RM presents a relative path as if it were an absolute path.
It is an assumption based on what happens when I change the names of the source file and RM Media folder (which still match). This arose when, having just updated to RM 10, I experimented with the implementation of relative paths.
Media items which were transferred to the media library at a time when the two did not match result in a link failure.
Media items which were transferred to the media library at a time when the two did match are resolved by RM.
Thanks for confirming that my assumption was correct and interesting point that you made about the way in which RM could generate a relative path based on the Windows Document folder.
I think that fix broken paths will use the relative path from the Media Folder. (on second thought, it may choose the relative path anchor that generates the shortest path length.)
So if you change a tope level folder, and then fix paths, the stored paths should be relative to the media folder. I have not tested this assumption.
From the read me file for the TestExternalFiles utility app-
Background information: File paths pointing to external files
in RM 7: all paths are absolute starting with a drive letter
in RM 8&9&10: absolute file path starting with a drive letter
or
a path relative to another location.
RM 8&9&10 Relative path symbols
(these are expanded when found in the first position of the stored path)
? media folder as set in RM preferences
~ home directory (%USERPROFILE%)
* RM main database file location
The TestExternalFiles utility app has the option of showing how the file path is stored in the database.
When RM fixes the links it appears to rebuild the paths according to the current settings.
All my media items now use relative paths (at least that is what experience tells me).