# Migrating from db4* to db5



## anigma (Mar 7, 2014)

Hello,

Last night I noticed the db4* port was marked as DEPRECATED. I've been meaning to upgrade from db4 to db5. However, I have a few questions before doing so. I have read the guidelines on https://wiki.freebsd.org/Ports/BerkeleyDBCleanup... just to point that out. 

Would `$ portmaster -RafCGK` suffice to rebuild all the ports properly? And will this remove my current configuration files?

/anigma


----------



## ShelLuser (Mar 7, 2014)

Some people found my recent writeup about it useful, perhaps that can give you some ideas?

I suppose you could rebuild everything but I also think that's a bit overkill since not every port will depend on the Berkeley database. At the very least I'd suggest to limit the rebuild to the ports which really need it, you can find those by checking the ports dependencies.


----------



## wblock@ (Mar 7, 2014)

Agreed.  Try to avoid rebuilding all ports.  Use `pkg info -ixr db4` to get a list of prts that require db4.  Back up, install databases/db5, edit /etc/make.conf, delete db4, then rebuild that list of ports.  Afterwards, run `pkg_libchk -o` to check for problems.


----------

