FREENAS : move iocage Jails to another pool


I am using FreeNAS 11.2-U7

I want to move my iocage Jails from a HDD pool to a new SSD pool.
I came across various instructions on iXsystems forums, one using a snapshot moved over to the new pool and doing some text replacements like this:

stop all plugins/jails
zfs snapshot -r main_pool/jails @relocate
zfs send -R main_pool/jails @relocate | zfs receive -v ssd_pool/jails
zfs get -rH -o name -s received mountpoint ssd_pool/jails | xargs -I {} sh -c “zfs set mountpoint=/{} {}; zfs mount {};”
change the jails pool from the UI

Tried it but didn’t seem to work (replaced jails with iocage since that was the “root” of the folder), can’t tell what I’m doing wrong since I am not an experienced user.

Is there another way to do it? Is there something missing from this procedure?

I wouldn’t want to mess up my entire config, it took me too long to get it to a good point.

Thank you.

Well, I bit the bullet and finally figured it out, with some trial and error.

I wanted to move jails from bluePool to ssdPool

  • logged out from the UI (don’t know if it played a part, thought to be safe)
  • iocage stop ALL
  • zfs unmount -f bluePool/iocage
  • zfs snapshot -r bluePool/iocage@migration
  • zfs send -R bluePool/iocage@migration | zfs receive -v ssdPool/iocage
  • iocage clean -a
  • zfs destroy -rf bluePool/iocage
  • iocage activate ssdPool
  • zfs destroy -r ssdPool/iocage@migration
  • zfs set mountpoint=none ssdPool/iocage/download
  • zfs set mountpoint=/ssdPool/iocage/download ssdPool/iocage/download

Last couple of commands were needed because when I issued
iocage list
I got
Please set a mountpoint on ssdPool/iocage/download
and I could not set the mountpoint just using the second command, I had to clean it up first (can’t tell if it was “locked” somehow by the previous setup, don’t know that much about FreeBSD).

Then I had to manually edit all the fstab for my jails
iocage fstab -e jail_name
and replace bluePool/iocage with ssdPool/iocage

That’s all. I logged in to the UI, started my jails/plugins and everything worked fine.

Hope it helps someone and if anyone has any idea why the iocage/download mountpoint failed to “migrate”, please let me know.