Since it seems like Media and Metadata directories are the largest space consumers in the data directories, I’d like to avoid backing them up.
Are these needed in backups and restores, or can a new PMS instance configuration be restored with old settings without them?
/Library/Application Support/Plex Media Server# du -sh *
631M Cache
6.6M Codecs
76K Crash Reports
512 Diagnostics
512 Drivers
3.5M Logs
2.0G Media
4.8G Metadata
512 plexmediaserver.pid
951K Plug-ins
268M Plug-in Support
2.0K Preferences.xml
5.5K Setup Plex.html
512 Updates
This is your actual Plex library database. If you exclude that, you might as well omit all the other files and folders, because they are useless without the database.
Does plex not have any backups in it’s directory structure for restoration in case of missing or corrupt primary database?
Nevermind that, I want to do a minimal backup: Enough that I don’t need to reconfigure the server and take ownership of it but not include current data because I’m fine with doing reindexing and rebuilding everything else as long as it happens automatically.
Is just the Preferences.xml enough for that or is there something else needed as well?
These are the files in the same folder, with the date in their file names. Plug-in Support/Databases/
You could exclude everything except the Databases folder. (and the Preferences.xml file, of course) Everything can be downloaded through a “Metadata refresh” or restored by the server’s nightly “analysis” tasks. (Though, depending on the server’s computing speed, doing so could take weeks, so you need to ponder which is more inconvenient. Longer backup time or the long reconvalescence after a restore.)
However, that would also remove every poster that you have “uploaded” through the Plex interface. Which is why you should never do that and put the poster beside the actual media files instead. Back them up together with your media.
The same applies to subtitles which were downloaded through the plex user interface.
I have a fairly beefy server and fast connection to media storage mediums, so I don’t think it would take too long. However, losing downloaded subtitles might be annoying…
I’ll reconsider the media and metadata directories (The reason I was raising this question is because I’m limiting the intermediary backup medium’s size and it is not enough for the full media backup; I’ll just use another medium).
However, it seems strange that you would advise backing up the in-use database and not just the backups; that’s just never a good idea in general. I don’t claim to be an expert on the app but generally that would lead to corruption or downtime.
Is it really necessary?
Can’t I just use one of the backed up ones when restoring the server?
Plex makes a copy of the database every three days if configured to do so. The default location is the same directory as the active database files. You can change the location if desired.
If you are OK with the information possibly being out of date by three days, then you can certainly use the backup files.
Consider backing up all of the backup versions. If you are restoring due to database corruption, you may need more than the most recent version, since there is no way to tell when the corruption occurred (the most recent version may be corrupt itself).
If you want to backup the active database files, stop Plex, backup the files, start Plex.
To stop Plex Media Server on Ubuntu (as root): systemctl stop plexmediaserver.service.
Thanks for clarification. I am backing up all plugin files except active database (as you may be able to infer from my top post).
And I remembered that the db backup directory is user configurable so you might not know where mine is, but it is set up to be in the same directory as the database files themselves (which is probably the default).
My backups are for disaster recovery purposes so being slightly out of date is not a problem. I just don’t want to bring down the service every time backups are made, or worse, cause corruption intentionally.
Summarily, I think keeping metadata and media files is necessary. If they only held data which is readily available from internet or that is generated from media files themselves, that would be one thing, but losing media customizations is a whole different can of worms.