Complete Plex (New Jail w/backup) Rebuild Instructions

saviodesign

Dabbler
Joined
Apr 7, 2017
Messages
21
Stop Plex services:
service plexmediaserver-plexpass stop

Backup the data

Note: Default DB back up location = “ /usr/local/plexdata-plexpass/ “

Navigate to the DB

cd /usr/local/plexdata-plexpass/


Tarball/Zip the DB (archive for later)
tar -czvf plexbackup.tar.gz Plex\ Media\ Server


Note: Depending on the size of your Plex Database, this may take some time



Open a second terminal and navigate to the tar file
cd /mnt/pool1/iocage/jails/plex/root/usr/local/plexdata-plexpass

Move the file to an external location OUTSIDE the Jail so you can find it later:
mkdir /mnt/pool1/DB_backup
mv plexbackup.tar.gz /mnt/pool1/DB_backup/plexbackup.tar.gz



Create a new jail
To create a native (empty) jail watch the first 1:25 of this video for an easy tutorial: https://www.youtube.com/watch?v=B1eO1PP195U

Install Plex Pass
pkg install plexmediaserver-plexpass
sysrc plexmediaserver_plexpass_enable=YES


Or

Install via Plugin using common settings:

Set IP to: 192.168.1.35/24

Set simple Mount Points
Source Destination
/mnt/pool1/media /mnt/pool1/iocage/jails/plex/root/media


Create the metadata directory by starting and stopping Plex:

service plexmediaserver_plexpass start
service plexmediaserver_plexpass stop



Restore the backup data:
cp /mnt/pool1/DB_backup/plexbackup.tar.gz /mnt/pool1/iocage/jails/plex/root/usr/local/plexdata-plexpass/plexbackup.tar.gz

Navigate to the DB folder and untar the file
cd /usr/local/plexdata-plexpass
tar -xzvf plexbackup.tar.gz


Note: This may take some time as well


Start Plex:
service plexmediaserver_plexpass start
 

CP Waite

Dabbler
Joined
Nov 4, 2016
Messages
19
Will this method retain played/unplayed, watched, date added, etc metadata? if so this simple guide is a godsend. Thanks for posting!

I used an older, currently unsupported method to make my plex jail back on FreeNAS 9 and any update past 1.14 with the PMS_Updater.sh script is breaking it. I've been fine with the 1.14 status quo for a while but now that I'm wanting to do live TV and DVR with an antenna, I've discovered that 1.14 is no longer supported by their EPG and won't enable the HDHomerun and DVR functionality. Cheers!
 

saviodesign

Dabbler
Joined
Apr 7, 2017
Messages
21
While these steps will retain the main items/digital constructs for your Plex DB metadata (e.g. indexing, media covers, information content, subtitle assignments, etc. ), I have not found a way to restore viewing history (yet).
 

TAC

Contributor
Joined
Feb 16, 2014
Messages
152
When I move from FreeNAS 9.2 to 11 I installed a brand new Plex server in a new iocage jail. Unfortunately I don't remember what folders/files I manually copied from 9.2 to 11, but all the information was carried over including viewing history.

Since something recent went wrong with my current Plex install (wouldn't update, or sync to phone, had to manual restart) I made a new Plex jail and was happy to find this posting. :smile: I copied all these files to the new jail but nothing was carried over. No metadata, history, or anything else. :-(

Does anyone know exactly what files contain playlist, history, or any of the other info Plex maintains? I really don't mind re-downloading metadata, but history and playlist would be really nice to have.
 

CP Waite

Dabbler
Joined
Nov 4, 2016
Messages
19
Just completed this LONG migration and I'm very pleased to say that it kept all my metadata and viewing history, etc.

I did a combo of following this guide as well as the official Plex guide here: https://support.plex.tv/articles/201370363-move-an-install-to-another-system/

One thing not mentioned was that I turned off "Empty trash automatically after every scan" as the Plex guide said to as well as signing out of the new server and stopping the services, etc. My media mount pint was the same as my previous server jail as well, so its possible that keeping the media linked without having to change directory paths made a difference? who knows.

Either way, thanks for the guide here, its proven to be incredibly helpful!
 
Top