Emby can't update after move to 12.0 beta

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Now I'm not sure about the link @tprelog posted

So the plugin basically installs emby-server and ffmpeg from the FreeBSD package repo. It's the same as

Code:
pkg install emby-server ffmpeg


You can see the packages to be installed and repository that is used in the plugin manifest -- The link I shared can show you the package version that is available from this repo for a FreeBSD release

It could be possible to update the Emby Server into the jail using source code of Emby?
...
As shown into this post it is possible to install emby 4.7 into freeBSD 12.

You could create a standard jail and possibly build the latest version of emby from the ports tree. I don't have any experience with this.

Anyways, it seems you have found the easiest solution with the post to install emby 4.7 - I realize it's not an update for the plugin but it appears rather trivial to have an updated version of Emby running in a standard jail.

That said, it doesn't seem like it would take very much to either update the existing plugin (or create an new one like emby-git) that installs an updated version from Emy's github releases. That is, as long as they continue to release the precompiled package for FreeBSD 12.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
So it simply means that Emby 4.6 is not yet supported on TrueNAS 12 ?

Based on your post to install Emby beta -- I just tried this on a test system with the Emby plugin and seems to work. If you try, just take a snapshot of your Emby plugin first, so you can revert if it does not go well.

Code:
iocage snapshot $JAIL_NAME -n $SNAPSHOT_NAME
iocage console $JAIL_NAME
pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/4.6.2.0/emby-server-freebsd12_4.6.2.0_amd64.txz
service emby-server restart
 

Mattia3rd

Explorer
Joined
May 13, 2014
Messages
57
Ok let's do a short recap:

1. It is possible to install the Emby server within a Jail following this Emby FreeBSD install guide . Please note that this is a new fresh install
2. The github plugin of Emby search for the latest available package for FreeBSD
which is, as per this doc freshports, version 4.5.4.0_1
This seems to be the reason why the TrueNAS plugin do not update the Emby package.
3. The third and new point is tricky.
Could I update manually the Emby server in the current Jail managed by the plugin?
If yes, how. Emby doc doesn't describe the process. Maybe it's just like the installation.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
1. It is possible to install the Emby server within a Jail following this Emby FreeBSD install guide . Please note that this is a new fresh install

Yep - while these instructions are for installing the beta version, you could just as easily use the latest stable release (4.6.2.0) instead. Just copy the link address for the desired release on the Emby release GitHub page

2. The github plugin of Emby search for the latest available package for FreeBSD
which is, as per this doc freshports, version 4.5.4.0_1
This seems to be the reason why the TrueNAS plugin do not update the Emby package.

You got it!

3. The third and new point is tricky.
Could I update manually the Emby server in the current Jail managed by the plugin?
If yes, how. Emby doc doesn't describe the process. Maybe it's just like the installation.

Yes, this is what I have tried on my test system and it seems to work

I installed the Emby Server Community plugin, as stated this installed Emby 4.5.4.0 - To upgrade Emby inside plugin jail, I used the following steps. Here I have installed the latest release, 4.6.2.0. You could also try the beta version or any other version for that matter.

- Replace $JAIL_NAME with the name you have given to your Emby plugin (you can use iocage list if you are unsure the exact name you've used)
- You can use any $SNAPSHOT_NAME that is meaningful to you

Code:
iocage snapshot $JAIL_NAME -n $SNAPSHOT_NAME
iocage console $JAIL_NAME
pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/4.6.2.0/emby-server-freebsd12_4.6.2.0_amd64.txz
service emby-server restart


For completeness I'll add, if the upgrade does not work as expected, you can revert the snapshot with the following (use iocage snaplist $JAIL_NAME if you are unsure the exact name of the snapshot)

Code:
iocage stop $JAIL_NAME
iocage rollback $JAIL_NAME -n $SNAPSHOT_NAME
iocage start $JAIL_NAME
 

Mattia3rd

Explorer
Joined
May 13, 2014
Messages
57
Now I'm trying the coolest thing..

As you did I created a new jail and installed the same Emby Server version..
I want to backup the current configuration from the jail and restore it to the new jail
Here come the troubles because, even if I followed the official Emby doc I don't have all the metadata/users/.. and configurations in general in the new jail..

Working on it

If you have any advice I'll listen to them
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
If you have any advice I'll listen to them

So first I would stop then make a backup of the existing emby-plugin. The following will make a zip backup that can be restored later, if needed.

Code:
iocage export $JAIL_NAME



In my own setup, I use a separate dataset for the emby database directory. This way I can reinstall the plugin or switch to a standard jail at any time. I assume your media is already stored outside the plugin as well.

The directory (inside the jail) that you'll need to back-up is /var/db/emby-server - You can also find this directory from your TrueNAS host - For example, if the name of your $ZPOOL is tank and the $JAIL_NAME is emby, the path would be /mnt/tank/iocage/jails/emby/root/var/db/emby-server

I would use the TrueNAS web UI and create a dataset called tank/apps. Then I would create another dataset tank/apps/emby-server - I name this dataset to match the name of the directory it will be mounted, but you can use any name.

Next from the TrueNAS Console, as root user, copy the existing configuration to the external dataset. It is important here, that both source and destination path end with a slash /
Code:
cp -a /mnt/tank/iocage/jails/emby/root/var/db/emby-server/ /mnt/tank/apps/emby-server/


At this point I would install the new Emby jail or plugin. Once Emby is installed, check to be sure the webui opens but do not complete the first time wizard or any other setup. Just make sure you can reach the Emby UI, then stop the jail. Next delete the existing configuration inside this new jail and create an empty directory to mount the external dataset

Code:
iocage stop emby
rm -r /mnt/tank/iocage/jails/emby/root/var/db/emby-server
mkdir /mnt/tank/iocage/jails/emby/root/var/db/emby-server


And add the mount point for the external dataset to the new jail.
Code:
iocage fstab -a emby "/mnt/tank/apps/emby-server /var/db/emby-server nullfs rw 0 0"


You should also add any other mount points you may have configured for your media as well. (You can switch back to the TrueNAS UI at this point) - It is important for this to work seamlessly, you should use the same paths as before, inside the jail, to mount your media. Once you've added all relevant mount points, you can start the jail again.

You should be able to log into emby in your new jail and have all your existing users and everything configured as it was before.
 

Mattia3rd

Explorer
Joined
May 13, 2014
Messages
57
Yes I did it!
I customized my installation a little bit differently but , for the most part now I know that the plugin can be upgrade.
And it worked like a charm

Thank you @tprelog for the details
:cool:
 
Top