Fixing broken links - potential side effects

Hi, we need to port over a project to another machine, unfortunately all links are broken since the file structure are changed and relative paths were not used when setting the project up

The project ist merged from three different projects and is 70% absolute paths and 30% paths to small pdf files that tropy probably created, when large pdf files were imported, and then single pages where associated with tropy items. These small pdf files all look like this:

/assets/e058b1eefc37c4ce177d29a73e45eec4.pdf

Now for fixing them, the 30% paths to the assets folder are probably all unsalvagable since other than the original files we do not have these small files anymore.

Regarding the 70% absolute paths, I intend to write a script that grabs the paths and filenames from the tropy-file, search for the file names in the new folder structure, and generate sql commands that adjust the paths. This should work since ALL filenames are unique and have not changed so I can auto-correct all these paths

But - are there side-effects from this? Can this go wrong and fuck up the project in ways I may not even see until it is too late?

Yes, if you know that all the files have unique names, the proposed script should work to fix all the paths. Even if the names have changed, it’s possible to find the files, if the images themselves have not changed, because Tropy stores all checksums. Ideally, the script could also move all the images into a common folder or folder structure, then you can convert the project to using relative paths at the end and move it easily.

Here is a similar script that we used a few years ago to find (and update) missing files and which could be helpful.