Jump to content

[FreeNas] Replicate All Unique Emby Settings & Metadata to New Jail


BrowseOfMedia

Recommended Posts

mastrmind11

I recently attempted a manual update of an Emby jail on FreeNas 11.1 which failed and I have since rolled back.

 

The jail is still working fine, apart from a few artwork / metadata related bugs, so I would like to create a new jail instance and migrate everything from the current emby server to a new one.

 

I have spent a lot of time & effort curating my own people / media metadata, so I don’t believe a simple library scan (on the new instance) will pull everything across (specifically people metadata).

 

Has anyone attempted this successfully?

 

In short, I’d like to:

- Migrate ALL of the metadata and settings (exactly) from an existing FreeNas jail to a new one.

 

All ideas welcome.

Try the FreeNAS or Linux subforums.

Edited by mastrmind11
Link to comment
Share on other sites

adrianwi

It should just be a case of copying across the /var/db/emby-server folder from the old jail location to the new jail location.  The exact paths will depend on the type of jails and how they were created, but once you know them you should be able to copy with a simple cp -R command.

 

I prefer to have this folder saved to its own dataset /mnt/pool/embydb and then mount this into the jail at /var/db/emby-server.

Link to comment
Share on other sites

  • 1 month later...
stuartsjg

Hello,

 

I am trying to do this having setup Emby on Freenas 11.2 using an iocage jail via the Feenas install plugin tool.   Another guide (i forgot where) suggested to install emby, but not proceede with the setup and shut down the jail.  Then copy the server data to the new jail.

 

However, i am looking and i am confused where the iocage jail files are stored.   Ive tried to share the jail folder as a mapped drive (as i had done for the old warden jails) but freenas wont share the path as its located here: /mnt/iocage/jails/emby/root/var. and "The path must reside within a volume mount point" .

 

This is the old warden jail, mapped to windows.

5bd61fdfbbb6d_emboldjailSMB.jpg

 

I believe i just need to get this lot put into the  /mnt/iocage/jails/emby/root/var/db/emby-server   folder and then i should be able to fire up the new emby iocage jail?

 

Thanks,

Stuart

Link to comment
Share on other sites

adrianwi

My preferred approach is to create a dataset on your pool for the emby data (I call mine embydb) and copy the files to that dataset.  So from the FreeNAS shell

cp -R /mnt/pool/jails/emby/var/db/emby-server/ /mnt/pool/embydb/

Once the files are there, simply mount them into your iocage jail as you would with your media

iocage fstab -a emby-server "/mnt/pool/embydb /var/db/emby-server nullfs rw 0 0"

If you ever need to rebuild the emby jail, you don't need to worry about the data as it's stored outside the jail.  It also makes backing things up much cleaner.

  • Like 1
Link to comment
Share on other sites

stuartsjg

Hi, thanks - good idea.

 

For me, i have two pools, one which is on a set of drives in a z1 array (media) and ive a pair of mirror drives for more important data as another pool.  I wanted to run the jails (and database) from the mirror drives as they are quicker than the z1 array so it should give a snappier response.

cp -R /mnt/z1array/Jails/emby/var/db/emby-server/ /mnt/redmirror/embydb/

this worked, and the data copied over.

 

 

i then modified your second command string, with the jail stopped, and ran as follows:

iocage fstab -a emby "/mnt/redmirror/embydb /var/db/emby-server nullfs rw 0 0"

On starting the jail i then got this error:

5bd77bf5726fe_mounterror.jpg

 

 

This is the full text of the error.

Error: concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 122, in main_worker
    res = loop.run_until_complete(coro)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 82, in _run
    return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 668, in nf
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 541, in start
    iocage.start()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1628, in start
    callback=self.callback
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 66, in __init__
    self.__start_jail__()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 413, in __start_jail__
    silent=self.silent)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 81, in logit
    _callback(content, exception)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 64, in callback
    raise callback_exception(message)
RuntimeError: mount: mnt/redmirror/embydb: Operation not supported by device
jail: /sbin/mount -t nulfs -o rw mnt/redmirror/embydb /mnt/iocage/jails/emby/root/var/db/emby-server: failed

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 161, in call_method
    result = await self.middleware.call_method(self, message)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1043, in call_method
    return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 980, in _call
    return await self._call_worker(serviceobj, name, *args)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1007, in _call_worker
    job,
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 938, in run_in_proc
    return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 923, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
RuntimeError: mount: mnt/redmirror/embydb: Operation not supported by device
jail: /sbin/mount -t nulfs -o rw mnt/redmirror/embydb /mnt/iocage/jails/emby/root/var/db/emby-server: failed

It was all going so well too :(

Link to comment
Share on other sites

stuartsjg

OK, i think it was unhappy as the  /emby-server/ folder was not empty, so within the iocage jail shell i deleted the emby-server folder.

 

Still could not get emby to start so via the UI deleted the mount point and added it again.  The jail then started without issue however then, going to the IP address i get "this site can't be reached".

 

Going into the jail shell, i can cd the directory and see that /mnt/iocage/jails/emby/root/var/db/emby-server contains the files it should.

 

So, a bit stuck.

Link to comment
Share on other sites

adrianwi

Not too sure why it didn't mount correctly, but you can remove it and try again.

 

iocage fstab -l emby (displays a list of the current fstab lines, including the INDEX number)
iocage fstab -r emby INDEX (removes the fstab line with the INDEX number used)

 

I usually use a mv /var/db/emby-server /var/db/emby-server-old command on a clean install to move the default files out of the way before mounting anything.  I know there was an issue on one version of FreeNAS where the iocage fstab failed if the folder wasn't there (e.g. create a blank /vat/db/emby-server after moving the old one), but pretty sure that's fixed in the latest versions.

Link to comment
Share on other sites

stuartsjg

Hello,  thanks for your patience and help.
 
I looked again at this with fresh eyes, deleted the new plugin jail and started again.

  • Installed jail from plugins list, installed OK.  Emby web setup guide loads
  • i close browser at this point (not going further on the install)
  • Within the jail shell  "mv /var/db/emby-server /var/db/emby-server-old"
  • Then a check "emby-server-old" exisits   "ls /var/db/"  - OK   (web interface still refreshes OK)
  • "mkdir /var/db/emby-server/" and check the new folder is there - OK
  • Stop the jail and go to freenas shell for   "iocage fstab -a emby "/mnt/redmirror/embydb /var/db/emby-server nullfs rw 0 0" "   (Successfully added mount to emby's fstab)
  • Start the jail (now status "up") and go back to the jail IP:port which was OK before and i get "This site can't be reached" from the browser.  

 

This is showing up and it looks to be correct:

5bda28cad889a_fstblemby.jpg

 

Going a bit further if i remove fstab 14 (and check it gone), then i dont ever get the emby start page to load, even after a jail reboot.

 

So it looks like its going wrong when i mount the jail and thats affecting the emby server in some way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...