How to prevent PMS from deleting data after large movie upgrade

Server Version#: latest as of 12/13/24
Unraid Version# 6.12.14

I can’t provide lots of info because PMS is stopped and I can’t turn it on.

I recently started upgrading (the dusty parts of) my library to higher bitrates and resolutions, which had not been done since my library began in 2009. When I stopped Plex and deleted all those files to make room for the new ones, I realized I had forgotten to press the button to prevent Plex from deleting the metadata when files go missing. When I turn it on, with 300 movies in a new location and slightly different names, all my metadata will disappear.

Can I access a Plex app file and change a setting to “false” or something similar to fix this?

Just to let you know, I’m not a coder-type, but I’m willing to dive into the console. I would just need thorough instructions.

Thank you!

Find the Preferences.xml file in your Plex data directory. Within, there is an option “autoEmptyTrash,” set by default to 1. Modify the file to set it to 0 before starting PMS again.

There’s information here regarding how to locate your Plex data directory:
https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/

However, using Docker, it is wherever you configured it when you built the container (the /config bind).

Also, backup Preferences.xml before making any modifications.

Further information on advanced/hidden server settings:
https://support.plex.tv/articles/201105343-advanced-hidden-server-settings/#toc-1

And if you’ve already started the server again with the media files gone, you may have to restore from a backup database.

1 Like
  1. restore a backup of the server database, from a date where the deletion has not occured yet: https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/
  2. disable the automatic emptying of the library trash

Now it depends on whether you have ever updated your library to use the modern metadata agent.
If you did that already some time ago, all should be well. Just add the newer versions of the movies and they should be recognized as being already in the library.

If you however never updated the library, things could get more complicated.

1 Like

I’m a modern and up to date MFer!

However, I see two solutions here, but seeing as you’re the Ninja, which one would be best in my situation.
Thanks for a solution and thanks for the snappy response too!

Ooo this seems great, thank you! I’m asking the Ninja on the thread what he thinks would be best but they both seem perfect to me. I just want the most bang for my buck so to speak.

Thanks for the rapido response!

We’re both saying basically the same. Follow whichever you like.

1 Like

So I tried to do this but the Preferences.xml doesn’t have the autoemptytrash line. Am I missing something?

EDIT: I fixed it with Otto’s method. I would have preferred yours though lol

1 Like

Ah, I should have mentioned that if not present that you can add it in manually. At any rate, glad you got it working!

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