Backup just server setting and watched status?

So I am going through the process of setting up backup for all my systems and I would like to backup my server settings for Plex

I recently had to set it up again and it was quite a pain for me to get the settings back to where they should be.

I did follow this article in advance of setting it up but it still was quite painful

https://support.plex.tv/hc/en-us/articles/201370363-Move-an-Install-to-Another-System

My understanding is that this process backs up things metadata, logs and other things which I really don’t care for. I really only want the settings for my server and the watched status. Everything else can be obtained again with little fuss I believe

I currently have the schedule task setup to backup the database, but I don’t quite understand what it is this does.

Ideally I want to be able to select the backup destination as part of my regular offsite backup, but I don’t know if this scheduled task suits my purpose.

Is anyone able to clarify for me exactly what the scheduled task does and if it suits my purposes? Or is anyone able to suggest some alternative for me?

I am running my server on a Synology NAS

Thanks in advance

The scheduled task just takes a snapshot of the database file and stores it beside the ‘live’ database.
Optionally to a different folder on your NAS.
https://support.plex.tv/hc/en-us/articles/202485658-Restore-a-Database-Backed-Up-via-Scheduled-Tasks-
Which contains your library definitions and the watched status.

Do keep in mind that ‘watched’ status is not bound to the file name but to the guid. This guid is dependent on which metadata agent was used to ‘match’ a particular file.
If you only use one type of metadata agent across a whole library, restoring your server will be relatively easy.
But if you used ‘Fix incorrect Match’ very often, this is quite hard to achieve, because on the new server you cannot perform the same manual ‘matching’ steps for every single video.

I am unaware or the “guid” issue but have moved com.plexapp.plugins.library.db
(\Plex Media Server\Plug-in Support\Databases) many many times between win10, synology and drobo!

The media location had to be changed if moving between different server machines (like PC to Synology etc)

Sometimes had to delete “com.plexapp.plugins.library.db-wal” and “com.plexapp.plugins.library.db-shm” from the new location for plex to restart.

@OttoKerner said:
The scheduled task just takes a snapshot of the database file and stores it beside the ‘live’ database.
Optionally to a different folder on your NAS.
https://support.plex.tv/hc/en-us/articles/202485658-Restore-a-Database-Backed-Up-via-Scheduled-Tasks-
Which contains your library definitions and the watched status.

Do keep in mind that ‘watched’ status is not bound to the file name but to the guid. This guid is dependent on which metadata agent was used to ‘match’ a particular file.
If you only use one type of metadata agent across a whole library, restoring your server will be relatively easy.
But if you used ‘Fix incorrect Match’ very often, this is quite hard to achieve, because on the new server you cannot perform the same manual ‘matching’ steps for every single video.

Sorry for the late response.

I have read this a few times but still have no idea if it answers my question or not. What are library definitions? Are these all the settings?

@mal68 said:
I have read this a few times but still have no idea if it answers my question or not. What are library definitions? Are these all the settings?

Sorry for being vague. I meant it stores which items are in a library and where the media files are supposed to be found. It also contains all the textual metadata (titles, release year, description etc) of your media. As well as the watched/unwatched information.

@OttoKerner said:

@mal68 said:
I have read this a few times but still have no idea if it answers my question or not. What are library definitions? Are these all the settings?

Sorry for being vague. I meant it stores which items are in a library and where the media files are supposed to be found. It also contains all the textual metadata (titles, release year, description etc) of your media. As well as the watched/unwatched information.

Thanks. What about server settings like network and remote access?

Sorry for the questions I just had a great deal of trouble getting these to work again so just want to know if I should back them up in some other way

I have also noted that despite having the box ticked to back up the database every 3 days, it hasn’t done it for 2 months, is this a known issue that I can fix?

@mal68 said:
Thanks. What about server settings like network and remote access?

Most of these settings are stored in the Preferences.xml file
https://support.plex.tv/hc/en-us/articles/201105343-Advanced-Server-Settings

I have also noted that despite having the box ticked to back up the database every 3 days, it hasn’t done it for 2 months, is this a known issue that I can fix?

The backup is done during the server maintenance period. Is your NAS running during those times?

Is your database damaged so that the backup operation fails?
You might wanna take a look into your Plex Media Server.log and seek for messages about ‘database corruption’. If you find those, repair your database.

Thanks for the Preferences.xml, that is what I was after and I will include that in my backup

My NAS is on at all times so that shouldn’t be the issue

I checked the log and there are no signs of database corruption, however I notice that the log doesn’t cover a large amount of time, only a small portion of the current day. Given that the backup is only meant to happen even 3 days would I need to look for errors around that time?

Obviously a bit out of my depth here

@mal68 said:
I checked the log and there are no signs of database corruption, however I notice that the log doesn’t cover a large amount of time, only a small portion of the current day. Given that the backup is only meant to happen even 3 days would I need to look for errors around that time?

Make sure you have ‘debug logging’ active.
Do not activate ‘verbose’ logging.
Settings - Server - General - (Show Advanced)

I’d check Plex Media Server.log shortly after the end of the maintenance time window.
There are ‘rotated’ logs as well, named Plex Media Server.1.log through Plex Media Server.5.log for older events.

Thanks I’ll do this

So there is no corruption best I can tell, checked after the maintenance period and there is no sign of the word corruption in the logs. I already had the right logs active too

Interesting thing to note though, in my /volume1/Plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/ directory I have 4 backup databases from last year named like this

com.plexapp.plugins.library.db-2016-09-03

Then I have one name com.plexapp.plugins.library.db with no date on the end that is from todays maintenance period. I did not notice this previously. Maybe it has been there previously and is getting replaced/updated every day or maybe this is the first time? Either way I thought it was supposed to name them with a date and keep three versions?

I will start to backup this directory but just seems like something is a bit off

@mal68 said:
Interesting thing to note though, in my /volume1/Plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/ directory I have 4 backup databases from last year named like this

com.plexapp.plugins.library.db-2016-09-03

Then I have one name com.plexapp.plugins.library.db with no date on the end that is from todays maintenance period.

This is the Plex database file itself. Don’t touch it, especially not while Plex Server is still running.

I did not notice this previously. Maybe it has been there previously and is getting replaced/updated every day or maybe this is the first time? Either way I thought it was supposed to name them with a date and keep three versions?

Those with the added date are the backups made by the butler. It is supposed to update them every 3 days.
If your backup copies are much older than 3 days, the backup did not succeed for some reason.

Have you given it a different backup destination path?
(Settings - Server - Scheduled Tasks)
Is this path really writable for the Plex user?

We might have to refer to a Synology expert from now on, because this touches upon ‘access permissions’, which are a big issue under Linux-based OSs.

I’ll post in the Synology forum

Thanks for your help with the original issue