Database migration from Windows to Linux braking file paths due to parentheses

Server Version#: 1.40.0.7775

I’m helping someone migrate from Windows to Linux. I’ve run into some path issues when migrating over specific files. When changing the root_path for a particular library, files with parentheses and brackets didn’t update their root_path (i.e. D:/Movies). All of the other files worked from what I can tell but if the file/folder name contained (2011) or something of the sort, it didn’t update the root_path. Even more odd, it doesn’t seem like this issue impacted other libraries. There are many examples in other libraries where files with parentheses worked fine. I loaded the sqlite db and looked at the file names in media_parts and found that there was nothing special about the path strings, there wasn’t even any escaping of special characters. I ran a query to update the base paths and flip the slashes to make it compatible with the unix path format and reloaded Plex, but it still can’t seem to see the files even if the path is correct. I haven’t yet tried to purge the special characters from all the files to see if that works but I first wanted to see if anyone has insight into this issue. All the databases and any important files are backed up so there’s no risk.

I tested a few things. I took an unmodified copy of the database from the Windows server and updated all the paths before migrating it to linux and starting up the server. Plex was still unable to find the files with parentheses. I then tried the same process but this time escaping the parentheses (.i.e. (2007)) and it didn’t work either. I’m going to attempt to validate my assumption with one of the files by removing any special characters.

One thing to note: for most files, if there are parentheses in the name it’s likely in the name of the folder containing it as that is his storage scheme.

I’ve tested removing the parentheses from both the file path and the media_parts file column and it fixed the problem, as expected. There doesn’t seem to be any reason why the parentheses wouldn’t work because other libraries don’t exhibit the same behavior. The only thing I can gather is that the files might have been imported with a non-standard scanner a while ago (looks like hana agent or something). I can remove all the parentheses (and hard brackets [ ]) but it would be interesting to know what a potential solution that avoids this would be.

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