# Extracting base.txz and kernel.txz over existing installation



## balanga (May 7, 2021)

If I have an existing 12.0 installation and I extract base.txz and kernel.txz from 13.0 on top of it, what is likely to happen?


----------



## SirDice (May 7, 2021)

It might work, I've done that to get completely hosed systems back working. But I would just use freebsd-update(8) if you can.


----------



## mtu (May 7, 2021)

It's likely to work, but beware of boot loader troubles when switching to 13.0 (search the forums, lots of people have run into trouble, especially with zfs).

Actually, I'm curious myself: Is there a way to take care of "deleted" files when updating this way? I.e., files that are present in the current system, but not in the extracted installation. They could be custom configuration files like /etc/rc.local, or they could be stale binaries or libraries removed from the system.

What I did last time was move the entire old installation into a folder like /old from another booted system, and then compare / and /old using `diff`. But I feel there's probably a better way.


----------



## SirDice (May 7, 2021)

mtu said:


> Actually, I'm curious myself: Is there a way to take care of "deleted" files when updating this way? I.e., files that are present in the current system, but not in the extracted installation.


It will require the sources but you can run `make delete-old` and `make delete-old-libs` in /usr/src.


```
delete-old           Delete obsolete base system files and directories
                          interactively.  When -DBATCH_DELETE_OLD_FILES is
                          specified at the command line, the delete operation
                          will be non-interactive.  The variables DESTDIR,
                          TARGET_ARCH and TARGET should be set as with “make
                          installworld”.

     delete-old-libs      Delete obsolete base system libraries interactively.
                          This target should only be used if no third party
                          software uses these libraries.  When
                          -DBATCH_DELETE_OLD_FILES is specified at the command
                          line, the delete operation will be non-interactive.
                          The variables DESTDIR, TARGET_ARCH and TARGET should
                          be set as with “make installworld”.
```
From build(7)


----------



## jb_fvwm2 (May 7, 2021)

`gtar` is what I had to use when I tried, successfully, to fix a hosed upgrade... [ vs regular `tar...` fwiw. [ might have been just an error with my usage of the latter. ]


----------



## balanga (May 7, 2021)

SirDice said:


> It might work, I've done that to get completely hosed systems back working. But I would just use freebsd-update(8) if you can.


After thinking about it then I should make a copy of at least group passwd and pwd.db in case I can't login afterwards. 

freebsd-update(8) takes a long time especially on a slow connection. I already have the two files I need so it shouldn't take long. The system I want to try it on isn't particularly important if thing go wrong.


----------



## SirDice (May 7, 2021)

balanga said:


> After thinking about it then I should make a copy of at least group passwd and pwd.db in case I can't login afterwards.


It's always a good idea to make backups of important files, just in case. Do /etc/spwd.db and /etc/master.passwd too. The actual user accounts and passwords are somewhat spread out over numerous files.


----------

