# Relative paths for media

**URL:** <https://gramps.discourse.group/t/relative-paths-for-media/2076>\
**Category:** Help\
**Created:** [December 25, 2021, 6:32pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076 "2021-12-25T18:32:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TarsolyGer](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@TarsolyGer](https://gramps.discourse.group/u/TarsolyGer)\
**Post date:** [December 25, 2021, 6:32pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/1 "2021-12-25T18:32:18Z")

</div>

Gramps 5.1.4 on Arch Linux and Windows.

Hi!  
So, I’m working on my family tree with my… family (I know, what a surprise). And recently I have installed Gramps for my mom on her Windows machine, but I also use two computers (both Arch Linux). I use Nextcloud to sync between the computers.  
Now, the issue is that while I use the relative paths for the media, when I set up the root directory for relative paths, that is saved in the database, so it won’t work when synced between multiple computers. With my laptop and desktop, I just well, manually changed it when I needed to work with it on the other computer, but I can’t really expect my mom to do the same on her Windows machine, as she is not that technical minded.

Is there any way to force Gramps to use a root directory for relative paths that’s configured outside the purview of the database?

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [December 26, 2021, 1:54am UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/2 "2021-12-26T01:54:03Z")

</div>

I wonder why the relative path for media is stored in the database instead of in the gramps.ini file. Does it have something to do with the option of creating a backup that includes the media files?

Anyway, I was going to suggest that you create a separate desktop icon for your mom to use, which would launch Gramps using a [command line configuration option](https://gramps-project.org/wiki/index.php/Gramps_5.1_Wiki_Manual_-_Command_Line#Configuration_.28config.29_option) to override that path, but I fear that might not work, if it can only override options that are in the ini file.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [December 26, 2021, 2:21pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/3 "2021-12-26T14:21:51Z")

</div>

A few questions.

1. If you can set the relative base media path in Gramps to Nextcloud on one computer, why can you not set it for all computers?

2. What path do you use for the Gramps database on each computer? I assume since you are using common media files, the database itself will be common to all machines.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [December 26, 2021, 2:29pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/4 "2021-12-26T14:29:52Z")

</div>

> [@GeorgeWilmes](#):
>
> I wonder why the relative path for media is stored in the database instead of in the gramps.ini file.

If you are using multiple database trees, you may want to assign each tree its own media path so the media do not mingle and and are already separated when you want to do something else with one of the trees (like delete).

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [December 26, 2021, 3:27pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/5 "2021-12-26T15:27:01Z")

</div>

I don’t know if there is a way, but it would surely be a good suggestion for improvement, because the base path is OS and user dependent.

Does your use of Nextcloud imply that you have your database in that personal cloud? If you have, please note that althoug SQLite is probably safer than BSDDB, it’s still not entirely safe, because of the nature of Gramps itself. It will probably work well between computers used by yourself, if you don’t make parallel changes, but if will probably go wrong if your mother does make changes while you’re working on the same object.

Can you tell us more about your workflow?

---

<div class="post-metadata">

**Author:** ![TarsolyGer](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@TarsolyGer](https://gramps.discourse.group/u/TarsolyGer)\
**Post date:** [December 26, 2021, 9:14pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/6 "2021-12-26T21:14:21Z")

</div>

@ennoborg @DaveSch  
thank you for help.  
Well, the database is located locally on my PC, as well as the media files. NextCloud is just the sync solution I use with my mom (previously, between my own computers I used a syncing method that is p2p). So, Gramps (and everything else, really) only works with the local files, the syncing is done with the third party apps (like the Nextcloud desktop app).

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [December 26, 2021, 9:54pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/7 "2021-12-26T21:54:16Z")

</div>

OK, is that a real time sync, like MEGAsync or OneDrive? I mean does it work in the background like they do, or do you start the sync yourself?

We had a discussion about Gramps on Dropbox drives long ago, which was considered risky, even though the files are on your local drive. In those days, Gramps used BSDDB, with every table in a separate file, and sometimes things went really wrong. With SQLite the database is one big file, but I would still be careful with that.

Also, do you both make changes to the database?

---

<div class="post-metadata">

**Author:** ![TarsolyGer](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@TarsolyGer](https://gramps.discourse.group/u/TarsolyGer)\
**Post date:** [December 27, 2021, 6:14am UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/8 "2021-12-27T06:14:22Z")

</div>

I know it isn’t considered ideal. In general, yes the sync is automated in the background, and I’d guess it can be considered real time.  
I set it up to back up the DB every time I close the app, so even if something goes wrong, I could restore it. We both make changes to the DB, but never at the same time (it was not an issue before as it was always me just at a different PC). I am vaguely aware of that not being a good idea. And, as I saw, gramps uses a lock file, which also gets synced. I will probably always get in touch with my mom if she wants to do any change anyways, as I said, she is not tech savy, and Gramps is a complicated software.

An other question: whenever I add a new media file, is the default behavior using the absolute path? I remember using the media tool to convert them to relative in bulk a few times before when I had some pictures not showing up properly, but I haven’t been actively adding new images for a while, just started now during the holidays, meeting my mom.

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [December 27, 2021, 9:49am UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/9 "2021-12-27T09:49:31Z")

</div>

> [@TarsolyGer](#):
>
> An other question: whenever I add a new media file, is the default behavior using the absolute path? I remember using the media tool to convert them to relative in bulk a few times before when I had some pictures not showing up properly, but I haven’t been actively adding new images for a while, just started now during the holidays, meeting my mom.

There’s a checkbox in the media file selector, to use relative paths, and in my experience its value is remembered, so once set, it will also be set next time.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [December 27, 2021, 12:47pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/10 "2021-12-27T12:47:39Z")

</div>

Have you tried making the Base Media path as simple as possible? As a default, each machine’s OS has pointed you to create the folder somewhere in the user’s folder structure. It is the user folder structure that is causing the issue.

`c:\Genealogy-Media`

For your mother, you can make a Quick Link of the media folder in her File Manager so she does not have to hunt for it if she needs access to the raw files.

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [December 27, 2021, 11:06pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/11 "2021-12-27T23:06:20Z")

</div>

@TarsolyGer you can even go further than @DaveSch advised here, by completely eliminating the base path. If you do that, all relative paths start at the user’s home folder, and there is no OS dependent data stored inside the database anymore.

What I mean is, that when you use a path like

/home/enno/Documents/Archive

on Linux, you will also need a path like

C:\users\enno\Documents\Archive

on Windows.

If you include the Documents/Archive part in the individual media paths however, and empty the base path, Gramps will still find the media on Linux and Windows, because it automatically adds the user’s home path, when the base path is empty.

And maybe even that home path can be changed with an environment variable, in case you have your mother’s My Documents (with the internal name Documents) on drive D.

Any my guess is, that you can make this change on Linux by letting Gramps change all relative paths to absolute, then empty the base path, and change all paths to relative again. But that is something that I haven’t really tried myself, so you’ll have to experiment a bit, and use backups where needed.

The underlying assumption here is, that on both Linux and Windows, you actually have a Documents folder with that exact name. But even if you don’t, you can also use a folder with a different name, like gramps-media, as long as it sits in the user’s home folder.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [January 26, 2022, 11:06pm UTC](https://gramps.discourse.group/t/relative-paths-for-media/2076/12 "2022-01-26T23:06:36Z")

</div>

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