PMS Database Files & Deletion

I’m runing the latest version of PMS on Windows 11.

I’ve been looking to do some housekeeping and general optimisation. I note that the largest files are in the ‘Plugin Support\Databases’ folder.

I understand that the core database files are:

com.plexapp.plugins.library.db
com.plexapp.plugins.library.blobs.db

and as you can see from my screenshot, these are 77GB and 33MB, respectively. However, there are a lot of other files in that directory, which look like incremental backups as they have recent dates in there and also have the same core database names, but with the dates appended to the end.

I then see the same core database names but with -tmp in the name. I suspect this was a failed upgrade as I had an issue earlier today after doing a general update (it’s all good now).

So, I’m speculating I can remove the -tmp files but what about all the others in the screenshot - apart from the two core database files, of course.

Don’t delete anything yet.

Please verify your version of Plex Media Server. “Latest” is not helpful, as there are multiple builds (public, beta, alpha, forum previews, etc.) that can be updated at any time.

There is a problem with some of the 1.41.7 builds that causes massive growth in the database files.

You’ve definitely been bitten. Your current database is 77 GB. Your backups on May 18th and earlier are 240 MB.

Stop the Growth

First, stop the growth. Either update to the current beta, 1.41.7.9823 (release notes), or fall back to to 1.41.6 (see this thread for download links).

Options

Next, you have a choice. You can either (a) remove the unnecessary information from the database, (b) restore a backup, or (c) wait on an update from Plex to fix the problem.

Cleaning the db may take minutes or hours, depending on CPU & hard drive/ssd speed. If you fall back, any play history, etc. since the backup date will be lost. Plex is working on a fix, where PMS will remove the unnecessary info, but it is unknown when it will be available.

Clean the db

To clean the database, you’ll need to use Plex SQLite to edit the database. See this post: Library.db size more than doubled in latest version - #186 by FordGuy61. The full thread has additional details on the problem and possible resolutions.

Restore from backup

To restore from a backup:

  1. Stop Plex Media Server
  2. Rename com.plexapp.plugins.library.db and com.plexapp.plugins.library.blobs.db to com.plexapp.plugins.library.db.bak and com.plexapp.plugins.library.blobs.db.bak.
  3. Pick the backup you wish to use, and remove the date from the db and blobs.db files so they end in .db.
  4. Start Plex Media Server
  5. Scan your libraries to pick up changes since the backup date.

Once you are comfortable that the server is stable, you can then remove old backups, etc. if desired.

Hi FordGuy61

Thanks for the response.

Yes, I really should know better than just to state ‘latest version’ and included the full version details :slight_smile: - so that is:

Version 1.41.7.9823

Interesting, I note you highlight to upgrade to that specific version or downgrade. I’d literally just upgraded yesterday, so I’m assuming that upgrading doesn’t rectify the issue of increased size for everyone?

Sounds like reverting to a previous backup is the best option, until a fix is developed by Plex. As the automated backups were taken ononly a few days ago, is it simply a matter of renaming the current backup files (Plex Server offline) to something like .BAK at the end and then renaming the two backups, in my case the ones with two with the 18-05-25, removing the space and the date from the filename, so they reflect what’s there as the current, live files?

Does doing the above effectively rollback the Plex version to a previous one? It looks like we’re just rolling back the database and any other updates provided in .9823 will still be there. I’m assuming therefore that’s OK?

What about those files with -tmp in the name?

Thanks very much for you help - much appreciated.

1.41.7.9799 or .9823 should stop the growth.

To restore an earlier version of the db, rename as I mentioned in prior post.

That effectively resets your server to the date the backup was taken. Rescan libraries to pick up any media added since then.

If the server is stable after the restore, you can delete the .bak files.

I’ve never seen the tmp or tmp-journal files on a Plex server. No idea what created them. Maybe if Plex tried to optimize or backup the db during Scheduled Tasks and the process was interrupted?

Notice the timestamps. They’re hours old compared to the db, so Plex wasn’t using them while running.

Still, just to be safe, stop Plex, move them out of the Plex Data Folder, then restart Plex. If things run OK, then delete them.

And if you restore from a backup then you can definitely delete them, since the backup predates them by several days.

Restored from the backup of the 18th May, restartred server and all working perfectly.

I’ve deleted the backup where the database had grown, along with the -tmp files (which I believe were created during the optimisation process that was disturbed.

Thanks very much for your support.

Good to read you’re up and running.

Monitor db size for a few days. If abnormal growth returns, fall back to 1.41.6 or earlier until Plex figures out a permanent fix.

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