Advice on backing up PLEX libraries

Status
Not open for further replies.

ghostwolf59

Contributor
Joined
Mar 2, 2013
Messages
165
Hi,
I just spent several days sorting out my media (i.e adding proper covers, linked to the proper artist/release etc etc) - needless to say it;s been a pain where plex made assumptions I;m not happy with when it comes to linking artists and media covers)

Well, job done and I now want to backup what I've got in case one of my drivers fails (which has been an ongoing theme over the past few years :( )

Plex posted some instructions on backing up plex libraries, but I cant see this applicable for a freenas setup and so far I failed to find a single post discussing this issue.

I'm in the habit of taking regular backups of freenas but I;ve noticed that a failed jail setup due to a failing drive often results in that I am forced to re install jail and all plugins from scratch when this happens.

My backups is based on RSYNC root down, but that wont re-create zfs datasets known to freenas (all libraries and content is properly backed up but if I need to swap in a backup drive non of these datasets would be defined (even though folders and content is there)

- So perhaps I;m doing something wrong with how I back up my drives :)

Even though it would be nice to find a simple solid solution that would allow me to swap a failing drive for a backup one my main interest at this point is if and how I could backup a previous installation of PLEX configuration and libraries holding all my previous mapped meta data (images, associated artists etc etc)
If I MUST re-install my plugins I can live with that, but I don't looking forward doing all this shitty work of mapping media, downloading covers, sorting etc etc) again.

So what would the best option be to backup your PLEX configurations and how would you go about updating a new installation from this backup ?

btw. I had discussions on regular backups in the past, but since freenas seem to force me to have these backup drives mounted all the time I option for a connect/backup/disconnect option (Rather have my backed up data in a safe place once it's been backed up)
I also think the regular automated backup created a problem in terms of space when you have multiple large drives


cheers
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Don't you have redundancy in your pool? Then when (not if) a drive fails, replace it, resilver, and go about your business. The manual has click-by-click instructions. That's the point of having redundancy. If you don't have redundancy, and you care about your data (which you seem to), why not?

As to backing up data from my server, I use crashplan and it seems to work pretty well. You should be able to do what you're looking for here by backing up your Plex metadata.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
assuming you are using the plugin, all of plex's data is stored in /var/db/plexdata.
 

ghostwolf59

Contributor
Joined
Mar 2, 2013
Messages
165
Don't you have redundancy in your pool? Then when (not if) a drive fails, replace it, resilver, and go about your business. The manual has click-by-click instructions. That's the point of having redundancy. If you don't have redundancy, and you care about your data (which you seem to), why not?

As to backing up data from my server, I use crashplan and it seems to work pretty well. You should be able to do what you're looking for here by backing up your Plex metadata.


I am not using a RAID setup - after being faces with a complete meltdown of my RAID5 setup some years ago I've decided to simply have n number of dedicated volumes.

The manual you refer to only discuss redundancy on a RAID setup - so my simple answer is NO, I do not have any redundancy other than keeping an eye on my individual drives growth and where needed replace the drive with a larger where I simply restore data from my previous backups.

cheers
 

ghostwolf59

Contributor
Joined
Mar 2, 2013
Messages
165
/var/db/plexdata

This location holds about 5.5Gb of data including local cache - Is'nt Plex relying on a library or database that can be restored?

ok, so assume I took a backup of this - would it be safe to fall back on this in the event I must re-install plex ? like, is this PLEX version independent that I can superseed using my backup or... ?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
This location holds about 5.5Gb of data including local cache - Is'nt Plex relying on a library or database that can be restored?

ok, so assume I took a backup of this - would it be safe to fall back on this in the event I must re-install plex ? like, is this PLEX version independent that I can superseed using my backup or... ?
I'm not sure what you are asking. The folder holds everything, probably an sqlite database, and a bunch of pictures related to your media.
If you backup and restore that folder to the same or a newer version of plex, Everything will be exactly as it was.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
This location holds about 5.5Gb of data including local cache - Is'nt Plex relying on a library or database that can be restored?

ok, so assume I took a backup of this - would it be safe to fall back on this in the event I must re-install plex ? like, is this PLEX version independent that I can superseed using my backup or... ?
Goal: Test if backing up /var/db/plexdata and copying to a new jail will preserve metadata.

Turn your active Plex jail off. Copy the /var/db/plexdata somewhere else. Create a new Plex jail, it will get a new name such as Plex_2 or something like that. Run the new Plex server and log on, this should then create the database. You will need to set your storage as you did with the original installation. Next, have Plex get the metadata - now the database should definitely be created. Now shut down the new Plex2 installation and copy over your database from your original installation. Restart Plex2. Check your media artwork.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Goal: Test if backing up /var/db/plexdata and copying to a new jail will preserve metadata.

Turn your active Plex jail off. Copy the /var/db/plexdata somewhere else. Create a new Plex jail, it will get a new name such as Plex_2 or something like that. Run the new Plex server and log on, this should then create the database. You will need to set your storage as you did with the original installation. Next, have Plex get the metadata - now the database should definitely be created. Now shut down the new Plex2 installation and copy over your database from your original installation. Restart Plex2. Check your media artwork.
there's no need to stop the second plex service assuming you never started it. just start after you copied the folder over, and set ownership to the folder to the plex user
 

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134
I migrated my library over from my previous nas and this is what I have done:
1. install plex plugin
2. don't start plex plugin yet
2. jexec <jailnumber> csh
3. Run the following to get the plex user uid
Code:
grep plex /etc/passwd | cut -f3 -d':'

4. create a new user in the freenas gui for plex with uid from above
5. create a new dataset named "plex" with plex user and group as owner
6. copy existing 'Plex Media Server' directory to the root of the new dataset
7. add this new dataset to jail storage with destination of /var/db/plexdata
8. remove old preferences file
Code:
rm /var/db/plexdata/Plex\ Media\ Server/Preferences.xml 

9. start plex plugin
10. update media locations for each library if path is different

I take a snapshot of this dataset once a week and back it up offsite. I have spent way too much time setting up Plex and was not about to go through all that again.
 
Last edited:

ghostwolf59

Contributor
Joined
Mar 2, 2013
Messages
165
I migrated my library over from my previous nas and this is what I have done:
1. install plex plugin
2. don't start plex plugin yet
2. jexec <jailnumber> csh
3. Run the following to get the plex user uid
Code:
grep plex /etc/passwd | cut -f3 -d':'

4. create a new user in the freenas gui for plex with uid from above
5. create a new dataset named "plex" with plex user and group as owner
6. copy existing 'Plex Media Server' directory to the root of the new dataset
7. add this new dataset to jail storage with destination of /var/db/plexdata
8. remove old preferences file
Code:
rm /var/db/plexdata/Plex\ Media\ Server/Preferences.xml 

9. start plex plugin
10. update media locations for each library if path is different

I take a snapshot of this dataset once a week and back it up offsite. I have spent way too much time setting up Plex and was not about to go through all that again.


Thanks mate - and I hear you loud and clear ;) - I've also spent heaps of time sorting sh#t out and don't want to go through this again if I possible.
- Will keep these instructions in a safe place for future use :)

Only question is if there's anyway to confirm this actually works? :rolleyes:
The earlier suggestion of installing another Plex jail have caused me some pain in the past with broken jails still sitting there with no way to clear it out :mad: - so unless I really have to I rather no install yet another one :cool:
 

ghostwolf59

Contributor
Joined
Mar 2, 2013
Messages
165
I migrated my library over from my previous nas and this is what I have done:
1. install plex plugin
2. don't start plex plugin yet
2. jexec <jailnumber> csh
3. Run the following to get the plex user uid
Code:
grep plex /etc/passwd | cut -f3 -d':'

4. create a new user in the freenas gui for plex with uid from above
5. create a new dataset named "plex" with plex user and group as owner
6. copy existing 'Plex Media Server' directory to the root of the new dataset
7. add this new dataset to jail storage with destination of /var/db/plexdata
8. remove old preferences file
Code:
rm /var/db/plexdata/Plex\ Media\ Server/Preferences.xml 

9. start plex plugin
10. update media locations for each library if path is different

I take a snapshot of this dataset once a week and back it up offsite. I have spent way too much time setting up Plex and was not about to go through all that again.


Thanks mate - and I hear you loud and clear ;) - I've also spent heaps of time sorting sh#t out and don't want to go through this again if I possible.
- Will keep these instructions in a safe place for future use :)

Only question is if there's anyway to confirm this actually works? :rolleyes:
The earlier suggestion of installing another Plex jail have caused me some pain in the past with broken jails still sitting there with no way to clear it out :mad: - so unless I really have to I rather no install yet another one :cool:
 
Status
Not open for further replies.
Top