Database files HUGE - com.plexapp.plugins.library.db file is 149GB

Server Version#:1.43.0.10162-720010162
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

First from the looks of it and doing some reading my DB files are MASSIVE. Not entirely sure what to do here as it is taking up a ton of room on my server. Am i able to delete any of these files or deflate them? I believe the ones with dates are backups, what about the TMP file?

Any help in bringing this DB size down is appreciated. See my image attached for file sizes and names

Hopefully not a repeat of this: Library.db size more than doubled in latest version

Some finer details: Library.db size more than doubled in latest version - #470 by FordGuy61

Question: DSM version?

Question: Do you install with Package Center or are you using Docker?

Database Bloat - Fixing the Problem

As @pl_5309 mentions, it looks like your system was afflicted with the database bloat bug in some 1.41.7 releases.

See my edit to the first post in this thread: Library.db size more than doubled in latest version.

It will give you info on two methods. Letting Plex clean the database will take many hours during which the server will be running, but not available. Using the shell script may still take a long time, but it will be faster. The tar file (in this post) is configured for DSM 7 systems with Plex installed via Package Center (hence my question above).

Read the info and write back with any questions.

Deleting Backup Datbase Files

The -tmp file is can be deleted. It is possibly a leftover from Plex trying to clean the database (note the date is 09/12/2025).

The files with dates appended are backups and not actively used by Plex. They can be deleted if necessary to free up space.

Before deleting them, suggest you do the following (I’m being a bit paranoid):

  1. Scan a library (generates activity).
  2. Pull the log files (settings → troubleshooting) and unzip.
  3. Look in Plex Media Server.log and the rollovers, .1.log to .5.log, for any ERROR entries that mention the database is corrupt or malformed. You can search for corrupt and malformed.
  4. If you find any such entries, stop, write back, and include the log files.

If there are no such entries, then:

  1. Stop Plex Media Server
  2. Delete the files with dates appended.
  3. Copy the active database files, com.plexapp.plugins.library.db and com.plexapp.plugins.library.blobs.db, to a place outside the Plex Data Folder (so you have a backup)
  4. Start Plex Media Server

I am on DSM 7.2.2 on a 224+ Synology.

I installed with the Package Center, however I run manual updates and don’t rely on the package center updates as they are lagging behind.

I deleted a the TMP and a few of the older back ups but have the two most recent still. After downloading and looking at the logs I did find a few mentions of pulse data being corrupt and a mention of a URL being malformed. Logs are attached.

Plex Media Server Logs_2025-10-03_10-54-15.zip (3.5 MB)

Thanks for the info.

Suggest you temporarily disable Settings > Scheduled Tasks > Backup database every three days. Otherwise Plex will continue to make backups. Re-enable it once the database is debloated.

The log files do not show signs of database corruption. The pulse data error looks like something to do with AAC audio, but that has nothing to do with de-bloating the database.

You’ve two options: De-bloat using the ChuckPa-Deflate script (requires SSH access to NAS) or let Plex clean the database.

There is no way to tell how long it will take to debloat the database. Suggest you pick a day where Plex can be offline for hours, then run the script or manually start the cleaning with WebTools.

Write back with how you would like to proceed, questions, etc.

Sounds good - I will proceed with the ChuckPa-Deflate script. I am familiar with this script in my previous research and actually did attempt to run this, however I stopped the script when trying to fix this previously as i thought it was hanging, but now that I know it may take multiple hours I will go that route. Cheers!

I just checked the tar file. It has paths for a Linux install (like Ubuntu), not for DSM 7. I thought it was set for Synology. I’ll look for a Syno version or modify the paths.

Actually spoke with ChuckPA on GitHub regarding this issue previous and he supplied me with a version. Take a look at this and see what you think.

If I may add here ?

I just happened to catch this.

I’m working on updating DBRepair to add the CORRECT method of deflating the databases.

The previous time, I didn’t have the correct keys inserted.
I now know how to do this without losing the statistics reporting.

If you’ll give me a bit, I’ll have something you can try

1 Like

Thanks Chuck!

Sit tight please ?

I’m not a SQLite guru. A member of the community shared a better way of doing the deflate.

I’m writing that code for DBRepair now.

(sorry – craaazy day here :zany_face: )

2 Likes

@bradleyschmaltz

If you’d be kind enough to make a backup of your Databases directory,
I’ll give you DBRepair to try as soon as I do initial testing here

1 Like

Fantastic. I can do that. I am just waiting for this to complete. Have around 25 minutes left on the backup operation.

@bradleyschmaltz

I’m running into a problem with my code. I’m going to put it down for a bit and come back after dinner when my mind is more focused.

1 Like

Hi Chuck,

You previously shared a deflate tool with me on GitHub. Am I ok to proceed with using that for now? Link to our discussion Checking the PMS databases - Stuck · Issue #246 · ChuckPa/DBRepair · GitHub

Thanks

That version has an omission which I will add to DBRepair.

I can give you the changes for it if needed urgently
-or-
I can put it into DBRepair for everyone.

How urgent is the need?

1 Like

It isn’t urgent - though I do have my server down for maintenance right now having notified my users. Do you have an ETA when it may be ready to use? I am hoping to have these repairs complete by tomorrow afternoon (around 24h from now)

Within 24 hours is NOT a problem.

It will be repaired -OR- :fire:

:zany_face:

lol

1 Like

Lol wonderful. I hope for the repair :slight_smile: Let me know once it is ready and I can be one of the first test subjects.

Chuck is a legend and fixed my problem! DB down to 250mb and running fast!

3 Likes