Migrating from FreeNAS 9 plugin to FreeNAS Corral Docker
Since I've seen a request for how to transition to the new FreeNAS docker containers with Plex and others are going to want to know the same, I figured I'd give a quick writeup on how to do this.
As a first note, I would highly discourage anyone from upgrading yet especially those who uses encrypted volumes. I initially ran through these tests using encrypted volumes and after the upgrade to Corral, the migration stopped until I unlocked the volumes (which is understandable). After doing so, the middleware crashed and never recovered. The system at this point is next to useless so I had to force a reboot. Upon it coming up again, the encrypted volumes were migrated and I could unlock them in the UI, but the migration could not be resumed as advertised; it was stuck in a partially migrated state. So I tried again without encryption. This time Corral failed to migrate the users (while it did migrate the groups). Clearly Corral is not ready yet.
Furthermore, if you rely on ACLs for permission access, these ACLs will not be honored in the container (known issue). I tested it with the media being owned by a different user than the
plex user, and the
plex user was granted access solely through the ACLs (those outside the user/group did not have access through unix permissions). You'll have to correct permissions on your media to work without ACLs in order for them to work within docker.
On to what did work: First, I had FreeNAS 9.10 installed with the main dataset called
tank. I created a standard plugin (not a normal jail) since those not using this method should be able to infer the steps they need to change. I have my media exposed to the jail at
I then upgrade to FreeNAS Corral. After it migrated, I opened a shell (not Corral's command line, a bash shell) since it makes some steps much easier. In the command line, we are going to get the user id that was used within the plugin/jail for Plex (only execute the part following the
% on a line that starts with
% sudo ls -ldn "/mnt/tank/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server" drwxr-xr-x 9 972 972 10 Mar 17 11:15 /mnt/tank/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server
In the above, you'll have to change
tank to match the volume name you used and you may need to change
plexmediaserver_1 to match your jail name. See this page for more details on where to find this data. Here the user id is 972 and the group id is 972 (the third and fourth columns); we'll need that later.
In the Web UI, create a new dataset to store the Plex metadata. I created mine at
tank/PlexMetadata but the name scheme and location is up to you. Now we need to create the skeleton directory structure and correct permissions. Again, change
tank/PlexMetadata below to the name you used. The
972:972 is the user id and group id obtained earlier
% sudo mkdir -p "/mnt/tank/PlexMetadata/Library/Application Support/" % sudo chown -R 972:972 /mnt/tank/PlexMetadata
Now copy the data over:
% sudo rsync -aP "/mnt/tank/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server" "/mnt/tank/PlexMetadata/Library/Application Support"
Note: ensure that you don't have any trailing
/s in either argument to the command. If such
/s are present, it changes the meaning of the command and will not result in the correct directory structure.
This process will take a bit, depending on the size of your database. The command above is resumable, so you can kill it and restart at any time. Now let's go create the container.
In the web UI, go to Docker -> Containers and create a container.
- You may select either
plexpassdepending on whether you want Plex Pass versions or not. If your account does not have Plex Pass, you will not get Plex Pass versions either way.
- Give the container a name. This is up to you.
- Leave the ports alone
- In Volumes, browse to the dataset you created above for
- If you want transcode temps to be stored outside the container, you can set the location for
/transcodeotherwise you can remove that volume.
- You should delete/modify the
/datamount to match the mounts you had for your jail in FN 9.10. In my case I had
- Set the timezone for
TZ(See this page for complete list)
- Since we are migrating an existing installation, you can remove
PLEX_GIDto the user id and group id above.
- Expand Network Settings
- If you change the network mode to
Bridged, you then setup the IP Address or DHCP and generate a MAC address. Additionally, you can remove the
ADVERTISE_IPsetting in this mode.
- If you leave the network mode on
NAT, then you should set the
If everything went well, you should see your shinny server at https://plex.tv/web (assuming you had previously logged it in). If you already have this page open, you may have to reload it so that the web app finds the server's new IP address.
As a final note, the docker VM is by default only given 1 core. You may want to change this if you do any transcoding. It is in VMs -> docker_host_0 -> CPU Cores. You'll have to manually reboot the VM (button at the top of this column) for this to take effect.