# Upgrading jail



## sompi (Jul 23, 2020)

Hello, need help with upgrading jail, i don't have ezjail.
My host system is 11.4 (world and kernel), my jails system is 11.4 kernel and 11.2 world, i want to upgrade world to 11.4.
I stoped jail and made

```
freebsd-update -b /usr/local/jails/first --currently-running 11.2-RELEASE -r 11.4-RELEASE upgrade
```
the result is on the screenshot




It supose to be more files no? So how to update world at jail ?
I tried

```
freebsd-update -b /usr/local/jails/first --currently-running 11.2-RELEASE -r 11.4-RELEASE install
```
but got error

```
src component not installed, skipped
Installing updates...mtree: /usr/local/jails/first//boot/kernel: No such file or directory
cd: /usr/local/jails/first//boot/kernel: No such file or directory
install: /usr/local/jails/first//boot/kernel/amdgpio.ko: No such file or directory
install: /usr/local/jails/first//boot/kernel/ccr.ko: No such file or directory
install: /usr/local/jails/first//boot/kernel/if_qlnxev.ko: No such file or directory
install: /usr/local/jails/first//boot/kernel/mlxfw.ko: No such file or directory
install: /usr/local/jails/first//boot/kernel/xz.ko: No such file or directory

Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
```

With command  
	
	



```
freebsd-update -b /usr/local/jails/first install
```
i got

```
src component not installed, skipped
Installing updates... done.
```
But world is still 11.2, i know there is a way with "installworld" and "mergemaster" but can i make it with freebsd-update?


----------



## SirDice (Jul 23, 2020)

Run the install three times in a row. The first run only updates the kernel (which a jail doesn't have), the second run updates world, the third run does some clean up of old files.


----------



## sompi (Jul 23, 2020)

SirDice said:


> Run the install three times in a row. The first run only updates the kernel (which a jail doesn't have), the second run updates world, the third run does some clean up of old files.


You mean freebsd-update -b /usr/local/jails/ftp install ? it's not helping, i made it
Hmm maybe it's because  when i'm doing "upgrade" command to jail





It says that only kernel/generic installed at jail, so it trying upgrade only it, why's that?


----------



## SirDice (Jul 23, 2020)

I think you messed things up somewhere. You can spend a lot of time trying to fix it but it's going to be easier to just create a new jail (with 11.4) and migrate the data from the old to the new jail.


----------



## Mjölnir (Jul 23, 2020)

SirDice, would it have been safer to update in steps 11.2->11.3->11.4 instead?


----------



## SirDice (Jul 23, 2020)

No, that would actually not be safer. Every upgrade has a certain risk, things could always break of course. But by talking the 'long' route you run that risk with _every_ upgrade step, instead of just once.


----------



## sompi (Jul 23, 2020)

SirDice said:


> I think you messed things up somewhere. You can spend a lot of time trying to fix it but it's going to be easier to just create a new jail (with 11.4) and migrate the data from the old to the new jail.



Interesting, what the easiest way to migrate data from one jail to another? If there is an easy way i will use it.


----------



## SirDice (Jul 23, 2020)

sompi said:


> Interesting, what the easiest way to migrate data from one jail to another?


I'm assuming you set it up originally. So I would hope you have documented what you installed and how it was configured. If you haven't documented it, now would be a good time to do so. Just look at what's installed on the old one and install what you need in the new jail. Then look at the data your application stored and copy that too.


----------



## zomar (Jul 25, 2020)

I'm using separate /etc/freebsd-update-jail.conf

with:


> ...
> # Components of the base system which should be kept updated.
> Components world
> ...



And then:


> freebsd-update -b JAIL_PATH -f /etc/freebsd-update-jail.conf --currently-running JAIL_VERSION -r JAIL_TARGET_RELEASE upgrade



Jail has nothing to do with "Components kernel" and in my case with "Components src" as well.


----------

