PMS Plug-in Support/Databases is 170GB!

Server Version#: 1.40.4.8679
Player Version#: N/A

I’m looking to start backing up my Plex Media Server (should’ve done this years ago!) and I found that my /$PMS_HOME/Plug-in Support/Databases folder has what appears to be weekly db backup files. The files I’m seeing are named like this:

com.plexapp.plugins.library.blobs.db-YYYY-MM-DD-tmp
com.plexapp.plugins.library.db-YYYY-MM-DD-tmp

These files have weekly iterations dating back to 2022, for a total of nearly 170GB! Is there a data pruning bug in PMS resulting in these files existing and not being pruned? What is expected behavior? Am I safe to assume I can backup all these *-tmp files? Without deleting these I won’t even have the ability to create a tar backup on the same disk!

And if there is by chance a configuration I may have set to cause such a thing to occur please let me know! I have a cron server that will begin doing these weekly backups and placing them onto my NAS, so I have no need for any kind of on-box backups going forward. Thanks!

In Settings → Scheduled Tasks, you can tell Plex to backup the database every three days.

Plex should keep only the last four backups.

Can you provide a ls -l of the directory?


Example (my server):

drwxr-xr-x 4 plex plex      4096 Jul 22 13:56  ./
drwxr-xr-x 7 plex plex      4096 Mar 16  2022  ../
-rw-r--r-- 1 plex plex 139509760 Jul 22 13:56  com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 plex plex 138989568 Jul 13 02:00  com.plexapp.plugins.library.blobs.db-2024-07-13
-rw-r--r-- 1 plex plex 139075584 Jul 16 02:02  com.plexapp.plugins.library.blobs.db-2024-07-16
-rw-r--r-- 1 plex plex 139268096 Jul 19 02:00  com.plexapp.plugins.library.blobs.db-2024-07-19
-rw-r--r-- 1 plex plex 139509760 Jul 22 02:04  com.plexapp.plugins.library.blobs.db-2024-07-22
-rw-r--r-- 1 plex plex 154927104 Jul 22 13:56  com.plexapp.plugins.library.db
-rw-r--r-- 1 plex plex 154267648 Jul 13 02:00  com.plexapp.plugins.library.db-2024-07-13
-rw-r--r-- 1 plex plex 153264128 Jul 16 02:02  com.plexapp.plugins.library.db-2024-07-16
-rw-r--r-- 1 plex plex 153587712 Jul 19 02:00  com.plexapp.plugins.library.db-2024-07-19
-rw-r--r-- 1 plex plex 153792512 Jul 22 02:04  com.plexapp.plugins.library.db-2024-07-22

I had the same problem.

On Linux anyway, if the backup directory isn’t OWNED by plex, then it will write the backup files but it will NOT be able to prune them–even if the directory r/w permissions are wide open.

This seems like a bug to me, but perhaps there is a galaxy brain reason why this is intended behavior.

Thanks @BanzaiInstitute. Yeah, this is definitely a bug. It should be caught with a notification displayed in the web ui.

@FordGuy61 I actually pruned all the files. But they all had the same naming structure as yours, except they were every 7 days and had a “-tmp” at the end, and they went back, one per week, to 2022-06-22. (Which presumably is when I enabled this database backup maybe, and likely the date when I built this PMS.)

There is a warning point here.

PMS won’t be able to complete backups when the DB is damaged/corrupted.

PMS will run with a damaged DB but the backups will be wonky and could easily end up this way.

Have you done integrity checks on it?

I ran full checks with the best integrity check script out there, written by @ChuckPa :wink:

DB integrity reported back fine. I’ll leave the scheduled task in place and see if comes back.

While I am sure that is true, it is also true in my experience that if the backup directory is not owned by the plex user, backups are written out but not cleaned up. When I had the same problem as OP I googled it and found a Reddit thread revealing the solution. After making the user/group ownership change on the backup directory, pruning worked as expected and has kept working for a year or so.

You may want to verify ownership and permissions for the Plex Data Folder (or wherever you are placing the backup files).

See Linux Tips: Migration from another OS to Linux.

The pertinent lines are:
Note 1: PMS must be stopped.
Note 2: Adjust accordingly if running Plex using a different user/group or files are in a different location.

  • Change the ownership of the files to the Plex user on the Linux host.
# chown -R plex:plex "/var/lib/plexmediaserver"
  • Make certain Linux file permissions are set correctly
# find /var/lib/plexmediaserver -type d -exec chmod 755 {} \;
# find /var/lib/plexmediaserver -type f -exec chmod 644 {} \;

My overall Plex Media Server install is about 150GB, even with the database issue pruned out now. Is it normal for an install to be that gigantic? I do have thousands of Movies & TV Shows and tens of thousands of albums indexed, so maybe yes? Are there any folders that can be omitted from the backup safely? I wouldn’t want to purge any manually created elements (such as manual artwork and tagging for home movies) but I’d be OK with letting the various metadata agents running to download all the other stuff again in the event of an actual disaster recovery, just to keep these backup files smaller (and the backup job quicker!).

When you have “thousands of Movies and TV Shows”, it will add up.
The biggest space consumers:
– Chapter thumbnails
– Preview images

These images are generated from every 5 minutes of video. They add up really quickly.

Over time, the PhotoTranscoder cache can build up junk which needs purging.

In my server,

  1. About 1500 movies (animated, 1080p / 2160p )
  2. 150 shows (full series)
  3. Chapter thumbnails and all superfluous (to me) images turned off.
  4. 35GB disk space used

I have seen some Synology servers with 500+ GB of server metadata in the “Plex” shared folder (equiv to /var/lib/plexmediaserver)

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