If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Is it possible to switch from plex plugin to a manual jail install on FreeNAS ?

treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass
edited September 2016 in FreeBSD

Is there a way that I can switch from the Plex plug-in I am using on my FreeNAS server to a manual jail install without losing my Plex library ?

I have been using the plug-in forever and recently completely wiped the system and rebuilt my Plex library to install FreeNAS 9.10.

Everything seems OK but the updates are a bit lacklustre especially as I've got a "Shiny" PlexPass.

Currently running

FreeNAS-9.10.1 (d989edd)
Plex Plugin 1.0.3.2461

Thanks in advance

treboR2Robert    AKA    Mr. Grumpy


PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

Best Answer

«1

Answers

  • TurboJailerTurboJailer Posts: 305Members ✭✭✭

    You're also going to want to move your database metadata and downloaded files after you've done the install.

    From the system shell type:

    rsync -av --delete "/mnt/name of your pool/jails/your pbi jail name/var/db/plexdata/Plex Media Server/ /mnt/name of your pool/jails/your destination jail name/usr/local/plexdata/Plex Media Server/"

    And then go make some coffee. Or a sandwich. Or walk your dog. It's going to take a while to copy it all over so be patient and let it run. It will drop you back to the command prompt when it's completed.

  • mikec_ptmikec_pt Posts: 593Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    I second the ZFS dataset for plexdata advice, and I would also add: make sure you enable "VIMAGE" for the jail. so the jail can have its own network stack.

  • TurboJailerTurboJailer Posts: 305Members ✭✭✭

    @mikec_pt said:
    and I would also add: make sure you enable "VIMAGE" for the jail. so the jail can have its own network stack.

    VIMAGE is enabled by default on a standard FreeNAS jail. Just create a standard jail with default settings and you're GTG.

    Moving the plex data to a separate dataset was one of my next items on my to do list. Keeps from having to move it from jail to jail if you need to re install such as I recently did with my move from FreeNAS 9.3.1 to 9.10.1.

  • treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass

    Thank you for everyone's responses I haven't had a chance to try anything yet but I will certainly get on it very soon and I will report back here with my results !

    I spent the last couple of days trying to get plex to use the dvd order instead of air date order for certain TV series. I eventually managed it thanks to a great plugin from someone on here.

    Heres a link to the thread if anyone is interested.
    https://forums.plex.tv/discussion/193459/dvd-order-agent-theme-music-fix

    treboR2Robert    AKA    Mr. Grumpy


    PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

  • wiser1000wiser1000 Posts: 23Members, Plex Pass Plex Pass

    I just want to say this was one of the most useful posts I've seen on either the Plex or Freenas sites. I know it must be difficult as many of the issues I have suffered have fallen between the two companies and me being such a dork on FreeNAS it has been hard. This worked first time "BANG" and even made me realise how to install webtools on FreeNAS for Unsupported APPs and Metdata Agents. After months of searching and hours of playing, I accomplished both in projcts in 2 hours. Even I'm stunned.

  • ra1k_0ra1k_0 Posts: 4Members, Plex Pass Plex Pass

    @gbooker02 said:
    Personally I have the /var/db/plexdata as a storage mount of a ZFS dataset on the main pool. This has several advantages such as setting snapshot/replication schedules on the metadata only. Additionally, if something goes horribly wrong with the jail, I can blow it away and create anew and if I set up the mount points the same way, it just works. I do the same with the configuration directories of all my jails and I've had to rebuilt a jail from scratch on one of them already (not the Plex jail) where this setup was immensely useful.

    Can I ask how this was achieved?

  • gbooker02gbooker02 Posts: 605Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee
    edited November 2016

    From memory, so a step may be missing or not quite accurate, but this should give you the idea:

    • Create a dataset to store the metadata on your pool
    • If you need to migrate existing data:

      • Add a mount to your jail to mount the above dataset to target a temp directory in the jail
      • Create a shell in the jail and run service plexmediaserver stop
      • Copy the contents of /var/db/plexdata to where you mounted your temp directory
      • mv /var/db/plexdata /var/db/plexdata.old
      • Shut down the jail
      • Change the mount in the jail for the database dataset to target /var/db/plexdata in the jail
    • else:

      • Stop the jail
      • Erase the contents of /var/db/plexdata in the jail
      • Create a mount for the above dataset to target /var/db/plexdata in the jail
    • Start the jail

  • treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass

    I know this is a bit late guys but I finally moved from the plugin to a manual jail tonight.

    I even put the "Plex Media Server" folder somewhere else and mounted it as a dataset.

    Just wanted to say thanks to everybody in here for the excellent instructions, it all went pretty smooth.

    There were two things I did different though.

    1. I moved the "Plex Media Server folder" using windows ( although it contained 137,000 files and took around 24 hours I-) )

    2. After changing from a plugin to a manual jail the "Plex Media server folder" is in a different location, it took me a while to figure this out :(|)

    As a plugin it is located at .../var/db/plexdata/

    As a manual jail it is .../usr/local/plexdata-plexpass/

    Thanks @sgaar
    Thanks @TurboJailer
    Thanks @gbooker02

    treboR2Robert    AKA    Mr. Grumpy


    PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

  • gbooker02gbooker02 Posts: 605Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    @treboR2Robert said:
    1. I moved the "Plex Media Server folder" using windows ( although it contained 137,000 files and took around 24 hours I-) )

    Doing an rsync or cp -a on the command line likely would have been considerably faster. I've used rsync to transfer the same folder over a network from one computer to another in a manner of minutes and mine contains over 300,000 files. Unless you have BIF (index) files, this directory is in the 10s of GB at most.

  • treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass
    edited February 1

    @gbooker02 said:

    @treboR2Robert said:
    1. I moved the "Plex Media Server folder" using windows ( although it contained 137,000 files and took around 24 hours I-) )

    Doing an rsync or cp -a on the command line likely would have been considerably faster. I've used rsync to transfer the same folder over a network from one computer to another in a manner of minutes and mine contains over 300,000 files. Unless you have BIF (index) files, this directory is in the 10s of GB at most.

    Yes i thought that after a few hours had passed lol.
    I am not the most experienced though and the long code that TurboJailer wrote out intimidated me a bit because it wasn't a case of just copying and pasting. I would have had to change directory paths etc and I got scared lol.

    It still surprised me though the amount of time it took because I cut and paste it from one place on the drive to another. When i do this with a 10gb movie it is instant.
    Copying it or moving it to another computer then yea i would have expected it to take that long.

    Anyway all done now thanks for your help Sir :-)

    treboR2Robert    AKA    Mr. Grumpy


    PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

  • TurboJailerTurboJailer Posts: 305Members ✭✭✭

    @treboR2Robert said:
    Yes i thought that after a few hours had passed lol.
    I am not the most experienced though and the long code that TurboJailer wrote out intimidated me a bit because it wasn't a case of just copying and pasting. I would have had to change directory paths etc and I got scared lol.

    Create a text file, copy code to text file, make edits, copy and paste into terminal window. ;)

  • treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass
    edited February 6

    I have run into a problem and I'm hoping one of you may be able to help me.

    I have transmission installed as a plugin and I just tried downloading something to my TV folder. ( /media/TV )

    Transmission is telling me "Error: Permission Denied"

    I have never had this before until I installed plex in a manual jail.

    I am assuming this is something to do with the last line of code from @sgaar instructions. (step 10)

    10 - Run ‘chown -R plex:plex /media’ on a command line to set ownership of the files (/media might be different depending on the mount points)

    Anybody have an idea of what I need to do ?

    Thank you

    treboR2Robert    AKA    Mr. Grumpy


    PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

  • mikec_ptmikec_pt Posts: 593Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    @treboR2Robert said:
    I have run into a problem and I'm hoping one of you may be able to help me.

    I have transmission installed as a plugin and I just tried downloading something to my TV folder. ( /media/TV )

    Transmission is telling me "Error: Permission Denied"

    I have never had this before until I installed plex in a manual jail.

    I am assuming this is something to do with the last line of code from @sgaar instructions. (step 10)

    10 - Run ‘chown -R plex:plex /media’ on a command line to set ownership of the files (/media might be different depending on the mount points)

    Anybody have an idea of what I need to do ?

    Thank you

    If its giving a permissions issue then you just need to make sure the user transmission is using has the correct access.

    You could have chown -R plex:some_group_transmission_user_belongs_to /media or you might even be able to use ACLs (probably more complicated)

    But firs you must figure out which user transmission is using.

  • treboR2RoberttreboR2Robert Posts: 252Members, Plex Pass Plex Pass

    Thanks for your quick reply, Unfortunately I know very little when it comes to freenas code so I am a little baffled by what you wrote there.
    I have no idea what user anything is using nor any idea how to find out.

    What I am wondering is if the last step (step 10) was actually necessary ? I have never had any permission issues before when plex was a plugin. And I never ever messed about with users or anything like that.

    If step 10 was not necessary is there a way that I can reverse it ?

    Thank you

    treboR2Robert    AKA    Mr. Grumpy


    PMS ( FreeNAS 9.10.2-U5 ) ( manual jail )    Rasplex ( Raspberry Pi 3 model B ) ¦ ( Raspberry Pi 2 model B x2¦ ( Raspberry Pi model B x2 )     PS3 & PS4

  • mikec_ptmikec_pt Posts: 593Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    Not reverse it per say... but if you know what the permissions were and which owner/group the folder was set to before that change you would be able to re-set again...

    Basically you need to make sure those files can be accessed from both plex and whatever other apps you need.

    A simply but insecure way to do it would be:
    chmod -R 777 /media

    If you're more used to windows, this means this dir (and subdirs/files) can be read and write to by everyone

    But ofc the idea way is to only allow access to the apps/users you really want to.

  • ValdhorValdhor Posts: 502Members, Plex Pass Plex Pass

    @mikec_pt said:
    A simple but insecure way to do it would be:
    chmod -R 777 /media

    Of course if it's your own server and nobody logs into it (in a *nix shell) then it really doesn't matter if the directory is insecure. go for it!!

  • NickF1227NickF1227 Posts: 12Members, Plex Pass Plex Pass
    edited September 6

    Hello all,

    rsync -av --delete "/mnt/tank/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server" "/mnt/tank/jails/plexpass/usr/local/plexdata/Plex Media Server"

    gives me

    rsync: mkdir "/mnt/tank/jails/plexpass/usr/local/plexdata/Plex Media Server" failed: No such file or directory (2)
    rsync error: error in file IO (code 11) at main.c(658) [Receiver=3.1.2]

    Any ideas?

    I SSH'd as root, am running this as root.

  • TurboJailerTurboJailer Posts: 305Members ✭✭✭

    Is your pool named "tank"?

«1
Sign In or Register to comment.