Changing directories of libraries

I’m using Plex on Docker on Synology NAS. I had to rebuild my NAS volume so I backed up the whole PMS data folder (/Library/Application Support …) and rebuilt my container without any issues. The artwork of the media I have are still intact.

However, along the way I also to edit the PMS library folder destinations as I moved my content to another location in the new NAS volume. After doing this, Plex had to download metadata and video previee thumbnails again. Is this to he expected when changing the library folder location even though the content of the media folder is exactly the same as before? If so, why can’t it use the old metadata and media data?

There is a process for moving your media that will allow Plex to retain that information:

I see. Exact steps I did were:

  1. Original media location was /video/Charmaine/Movies and /video/Charmaine/Shows
  2. Recreated the whole NAS volume
  3. “Application Support” folder path did not change (/docker/appdata/plex)
  4. Recreated the docker container with volumes that now point to /video/charmaine/movies and /video/charmaine/shows . Content from the old media folders are exactly the same as the new one.
  5. Started PMS.
  6. Edited the libraries to reflect the new location and they started fetching metadata from scratch automatically. Did not need to “scan library files”

So if I understand correctly, the incorrect thing that I did was that I did not add the new location but instead edited the old location to reflect the current location, correct? If I add the new location and then let it scan for the media there, wouldn’t it fetch the metadata from scratch?

Why do we need to disable the emptying of the trash for this whole process?

Also, the fetching of the metadata from scratch is done already. Is it worth it to do the process all over again and do it correctly? I have a backup of my plex application data folder anyway. I can easily restore the original data and recreate the container but I’m not sure if it’s even worth it knowing that the metadata is complete on my libraries now. If it’s not worth it, how do I get rid of the duplicate/old metadata that I have on the folder now? What is the correct cleanup process?

Ok, I could not resist the itch and started back to restoring the original data and redoing everything again but this time following the article. I followed the article to the letter, and it’s redoing the “generating video thumbnails” part again. I thought PMS is smart enough to tag the same metadata for the media in the new location? What is wrong?

I would like to know a bit more about this too. I’m a little surprised it needed to regenerate the Indexes for you after you followed the second “Preserve your Library” process.

I’ve seen Plex be very clever about this. It will recognize files being renamed, moved between libraries, etc. If the same file is in two libraries, it’s still clever - no need for duplicate Indexes (video preview thumbnails). I’ve used this successfully to keep all sorts of file maintenance quick and avoid rematching.

And to prove that point to myself, I just stopped Plex, renamed a directory, copied a file to a new name (new inode) and deleted the original, touched the file (to change the date), and restarted Plex. I scanned while the file wasn’t available, then made it available again. When I scanned the Library, Plex recognized the file with the new name, path, inode, and date, and didn’t need to match or create Indexes (video thumbnails) again.

It seems pretty clear that Plex is hashing some of the data from files and using that to track & index them. (Edit: and I see comments in the forum from @OttoKerner that this is indeed the case.)

But the other day I slightly renamed a bunch of files, and Plex didn’t seem to recognize them. They have “old” dates so they haven’t been modified. But Plex wanted to generate new Indexes for many/all of them.

I was surprised by this - maybe I just did something funky. No big deal, I let it crunch away for a bit and it finished.

I’m curious if somebody who knows how the file matching works could speak up. Did I do something dumb? Too many at once (hundreds)? Cross the streams? Violate a rule?

That’s interesting. And that’s make it more confusing. I hope somebody can chime in regarding how the matching is really done on the backend.

How do I make sure that old metadata/video preview files that are not being used are deleted?

I know that one: Empty Trash and Clean Bundles. Any Library entries with no files are cleaned up, and any previews or other data associated with removed files are … uh, removed.

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