What's the best way to ensure media path cross-OS compatibility?

I want to bundle some sample media with a developmental Tree. (The reference documents and genealogical test data for developing a Descendant report in the NEHGS Register style.)

The Media includes scans of 3 articles (over several decades) about the format expected for their report, a word processing document with a stylesheet, a text document, a GEDCOM with the genealogical data, and a ZIP with the preliminary Report addon.

What can I do to ensure the least aggravation restoring the media of the .gpkg to Linux, macOS and Windows?

Is there a way to set the media path to be a subfolder in the same folder with the SQLite files?

The base path is irrelevant because when imported, Gramps will create the new media folder based upon the file name and store that in the base path.

Making sure that the path field in the media records are all relative is more important.

2 Likes

When you create the new file/database, try setting the base media path before you do the import. At least on Windows, that is where the import will create the media folder (again based upon the file name).

1 Like

Is there a way to check for Media that have (or do NOT have) a relative path? I don’t see a Custom Filter Rule for that. Although the “Media objects matching parameters” rule has a “Path”, I do not know if that could be used to search for Relative Path use.

Sort the view by path.

Media Manager will convert the paths.

1 Like

On Linux, if the Media Path on file being imported is a mismatch, the following dialog appears.

On Reddit, a user asked about migrating from a Windows laptop to a Pop OS linux laptop.

One recommendation was to import a .gpkg backup from the Windows box to Pop!_OS. And although there might be some one-time challenges resolving the Media base path and absolute paths, that seems reasonably straightforward. (My experience with importing media has been less than satisfactory. So I’d probably manually extract the media and data.gramps files from the .gpkg backup archive, then only import the data.gramps. Then try one of the several workflows for resolving the filepaths.)

But what if someone wanted to use a shared Gramps tree and Media collection from different OSes? (Either from a portable collection on USB or a shared fileserver on a home network.)

Could Gramps handle moving between OSes without having to rebuild paths every time?

Yes, no problem, if you have relative paths, and use backups without media. I never tested your scenario of importing data.gramps from a backup with media, but it might work too.

If you have relative paths, and a base path like

C:\users\ennob\Documents

on Windows, Gramps should immediately recognize all paths if you restore the media into

/home/enno/Documents

on Linux, and set the base path accordingly. And you can do a similar thing on OS-X, which is also a sort of unix.

1 Like

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