How do you remove "Unavailable" files from the database when file names are changed?

  • I have a TV shows library set up on a Windows Plex Media server (v 1.2.7.2987) and everything was working fine

  • I added a new season with 8 episodes for one of the shows

  • I notice the episode file names were not quite right so I renamed them (a couple of times) using the Windows desktop file explorer while the media server was running

  • The media serve is set up to automatically update when library changes are made

  • When trying to view the new episodes in the Plex Media Player, a small blue ā€œ2ā€ was displayed next to the new episodes and the episodes were ā€œUnavailableā€

  • In looking at this further, the server still had the original file names (which no longer existed) in the database as as well as the new episode file names. The episodes were however shown as being ā€œUnavailableā€.

  • I ā€œUpdatedā€ and ā€œRefreshedā€ the library on the server several times but there was no change, the episodes were still ā€œunavailableā€ and both file names remained in the database.

  • I ultimately ā€œDeletedā€ the library and ā€œAddedā€ it again which refreshed the database and fixed the problem

  • However, this took a long time to download all the meta data again for all the shows and also reset the ā€œviewedā€ flag for all the episodes that we’ve already watched - sigh…

Is there an easier way to avoid this or fix it if it happens again? It seems to have been caused when the name of a library .mkv file was changed several times while the server was running and the Plex Server did’t remove the old file name from the database when the library was updated. Instead file was flagged as being ā€œUnavailableā€ even after the library ā€œUpdatedā€.

1 Like

Empty Trash after you update the library. This should remove the unavailable item creating the duplicate.
Library Actions

1 Like

I am also experiencing this exact problem, with a rather large database of movies that was previously working well.
I changed the desired naming scheme for all my movies, and renamed all the video files as a result. I then went into Plex, performed a Scan to update the database so Plex would find the new file names, then deleted the Trash and refreshed metadata.
None of the movies for which the file name was changed are available. Looking at the information for each movie entry, Plex is still pointing to the deprecated naming scheme/location of the movie.

Aside from deleting and re-creating the entire library, how do I refresh the file associations within the database to recognize the name change? Not only does Plex no longer correctly associate to the movie files, it no longer picks up new movies that are added to the library file path.

1 Like

If you changed the library file path itself, you must edit the libraries inside Plex and update them to the new folder name(s).
https://support.plex.tv/hc/en-us/articles/200289266-Editing-Libraries
Go to the ā€˜Add Folders’ tab and verify that the folders referenced in there are still in existence and accessible.

Thank you for the suggestion, I have not changed the path to the library at all. The only thing that was changed is the name of the video files inside the library directory.

I can tell you that I used filebot to recently rename thousands of files. Every single movie and TV episode that I have. All I had to do was
-Scan Library Files
-Optimize Database
-Clean Bundles
-Empty Trash

I used this rule for movies
{plex} [{vf} {vc} {source} {ac}-{channels}]

I used this rule for TV Episodes
{plex} [{vf} {vc} {source} {ac}-{af}{subt}]
TheTVDB as the datasource

I can confirm that afterwards It was amazing, over 99.9% accurate matches. no issues at all with missing or unavailable shows

1 Like

@mervincm said:
I can tell you that I used filebot to recently rename thousands of files. Every single movie and TV episode that I have. All I had to do was
-Scan Library Files
-Optimize Database
-Clean Bundles
-Empty Trash

I used this rule for movies
{plex} [{vf} {vc} {source} {ac}-{channels}]

I used this rule for TV Episodes
{plex} [{vf} {vc} {source} {ac}-{af}{subt}]
TheTVDB as the datasource

I can confirm that afterwards It was amazing, over 99.9% accurate matches. no issues at all with missing or unavailable shows

Unfortunately my experience was not anywhere near as seamless! I did the same as you, using FileBot, with a similar naming convention… but none of the movies were available after the rename. I did the Scan > Optimize > Clean > Empty Trash sequence as well, but to no avail.

I have deleted the library and am re-scanning the files. I’m assuming it will work, but thanks for the help anyways.

I’ll try out your naming convention, but will probably stick with mine, as it does a better job of handling movie collections (year in front of collection folder names so they are organized in the file tree by release date).

Thanks, this helped a lot!

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