I thought I’d rebuild my Plex Media Server (PMS) jail today, so it’s using the latest FreeBSD 10.3 template which would hopefully mean when the next PMS update was released, I’d have no problem updating the jail.  While the 9.3 template jails continue to work on FreeNAS 9.10, comments on the forum seem to suggest that updating using packages or ports won’t work, so I was trying to get ahead of the game!

I was expecting it to be relatively straightforward, and rebuilding the jail bit is:

  • create a new jail from the Jails menu by clicking Add Jail
  • Enter a name and IP address and click OK
  • SSH into the jail and then update > pkg update and pkg upgrade
  • Install PMS > pkg install plexmediaserver
  • Update the rc.conf file so the service auto-starts > nano /etc/rc.conf and add in the line ‘plexmediaserver_enable=”YES”

Pretty easy, yes?  Well, that bit was.  The problem started when I looked to move my plexdata folder from the old jail.  The plexdata folder contains all the library information and metadata.  Not the actual media content, which is stored elsewhere on the NAS and simply mounted into the jail, but all the information PMS has gathered from the internet about the media content, and most importantly, what I’ve watched and haven’t watched.  I really wanted to keep this, and thought it could just be a case of copying from the old jail to the new > cp -R /mnt/pool/jails/old_jail/usr/local/plexdata /mnt/pool/jails/new_jail/usr/local 

Well, it turns out this folder is pretty big and contains hundreds of thousands of files, so copying proved problematic using the FreeNAS shell!  After a few failed attempts trying to compress (tar) the folder and copy that, the solution I found was to SSH into FreeNAS from my iMac and then copy from there.  Even that took almost 2 hours, but the session remained active and I think everything copied across?

After mapping all the mount points to the new jail (using exactly the same names) and restarting the jail, I couldn’t connect to the new PMS.  I checked that the service was running, which is was.  I checked all the media mount points were there, and they were (not that I expected that to be the problem).  Finally checking permissions between the old jail and new, I released the plexdata folder needed to be owned by the plex user so just a case of > chown -R plex:plex /usr/local/plexdata.

After moving the Preferences.xml file that I’d moved, PMS started up and everything appears to be working as expected.  I’ll leave the old one running for a few days whilst I test the new one and then move my friends and family shares across to the new library.  I’d be surprised if they even notice!  I’ll also need to change the mount points for my PlexPy (a monitoring program to show who watches what) and PlexEmail (which sends out weekly updates of what’s been added) jails as they both need access to the plexdata folder.

Slightly more problematic that I expected, but good to know that I shouldn’t have any issues updating Plex in the future now (famous last words)…