Plex Database is massive after recent updates

Server Version#: 1.41.7.9823

I noticed in my backups folder my PLEX database has grown 20Gb out of the blue with the last few beta pass updates. I’ve not added more than a few movies or show episodes in the last week or anything that would cause this kind of massive growth.

Does anyone know how I can clean this up or “fix” the size? I can’t run the Optimize function either now, the entire server just hangs and eventually freezes/stops loading.

There was a bug in a recent beta that caused the database size to explode. See Library.db size more than doubled in latest version - #64 by drzoidberg33

The workaround has also been integrated into DBRepair: GitHub - ChuckPa/DBRepair: Database repair utility for Plex Media Server databases

Very long thread on the topic: Library.db size more than doubled in latest version

Earlier versions of 1.41.7 have a bug resulting in massive database growth.

You can either (a) fall back to a database backup, or (b) manually remove the unnecessary data from the database file.

The thread mentions multiple options to delete the data.

This worked on my PC: Library.db size more than doubled in latest version - #186 by FordGuy61

This option does the same thing and appears to be much faster: Library.db size more than doubled in latest version - #188 by hlve

2 Likes

Thank you thank thank you! I’ll be doing this today the moment I can get my husband off Fantasy Life for five minutes…

For anyone coming behind me looking for a solution, the DBRepair tools did not shrink the database back down. What worked was running these commands manually (you may have to adjust DB location if you stored it somewhere else). Shrunk my 24Gb database back to 2Gb in moments.

c:\>"C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe" "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db"
sqlite> delete from statistics_bandwidth where account_id is NULL;
sqlite> VACUUM;
sqlite> .quit

From this: Post from FordGuy61

AFAIK not both Windows versions might contain the necessary commands. And you’d need to download the latest version, not use one that you may have downloaded up to a few days ago.

As @OttoKerner mentions, download the current Windows version.

“delete from statistics_bandwidth…” has now been added to both the .bat and .ps1 versions.

1 Like

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