Migrate OpenBSD from i386 to amd64

In fakt it's really simple.

First save a list of current installed packages and remove them all.

# pkg_info -m > packages.txt
# pkg_delete -X

Than perform an upgrade as usual using a bsd.rd from amd64 architecture. Boot the upgraded system. Don't forget sysmerge, in case you're mixing an regular upgrade and architecture switching. I suppose an upgrade over extracting the tar's could work too, but I didn't test it.

Finally install all previous installed packages for a new architecture.

# export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m)
# pkg_add -z -l packages.txt

Boot your system again to be sure everything works as expected. And your are done.

Caveats

There may be some extra work. For example if you are using munin you shall dump all it's rrd data sets prior migration

for i in *.rrd; do rrdtool dump $i > $i.xml; done

and restore them after

for i in *.xml; do rrdtool restore $i $(basename $i .xml); done
By Dimitri Sokolyuk
Related articles