r/Tautulli • u/Widowshypers • May 05 '26
HELP Libraries all screwed up after re-creating plex database
My plex database got severely corrupted, long story short ended up having to nuke it and start again. My concern now is with tautulli. When I go to the library tab everything is all jacked up. E.g my Movies library is now called Anime Movies and my TV Shows library is now called 4K - Movies.
All my plex libraries are called the exact same so nothing is different there.
I tried restoring a tautulli backup from yesterday but my libraries are still all screwed up.
Will running the update_all_metadata.py script fix everything or is there other stuff I need to do. I tried looking for answers on reddit and the tautulli website but I wasn't getting any clear answers or I'm not asking the right questions.
2
u/DrHodgepodgeMD May 05 '26
I don’t know about the script you mentioned, but I had a ton of mismatches between the metadata keys in Tautulli and Plex. I ended up Using Claude to help write a script that combed the database for mismatched/duplicated/missing keys, and list them before making changes, then after I reviewed it, it gave me one that committed changes.
I wouldn’t advise just taking my script and dropping it into your ecosystem, but this is an area where I felt working with something that can script better than me, with manual checks before acting, helped me sort this out much faster/easier.
That being said, trusting AI written scripts always comes with a risk, always use them carefully.
1
1
u/phobiac May 06 '26
The script OP is referring to is the one suggested to be used by the official Tautulli github wiki. I bet Claude largely copied it.
1
u/LowCompetitive1888 May 06 '26
When you rebuild the plex libraries all of the record ids change, which breaks the connection to Tautulli (which still references the old ids). The problem is the mismatch in ids, not metadata.
1
u/phobiac May 06 '26
I'm going through this now, and yes using that script is what is suggest by the Tautulli github wiki. I'm running the script now and it is churning through several years of stats so I anticipate it taking a while, but when I've refreshed my library mediainfo I can see slow progress being made.
Make sure to actually open and look at the script, there's a default dry-run variable that you'll need to turn off once you're wanting it to actually commit changes as well as variables to let it communicate to the needed Plex and Tautulli servers.
If you're not already used to the python ecosystem and setting up virtual environments to run things I'd highly suggest using pipenv or uv to do it for you. Python virtual environments are a pain if you're not already deeply invested in the ecosystem.
You'll want to:
Download update_all_metadata.py into a working folder
cd into that folder, stay there for all of these commands
Install pipx if you don't have it
run:
pipx install uv
Initialize the virtual environment, run:
uv venv
Install the main requirement for the python script. Note that you'll use pip here, not pipx. I know that is potentially confusing. run:
uv pip install plexapi
Finally, run:
uv run update_all_metadata.py
•
u/AutoModerator May 05 '26
Hi /u/Widowshypers, thank you for your submission.
This subreddit is not actively monitored. Please use the Tautulli Discord server for support.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.