Upgrading NetBSD to a newer version from distribution sets generally looks like the following;
- Fetch new distribution sets (or roll your own).
- Upgrade the kernel.
- Unpack the distribution sets over the root directory, without fat-fingering the command and unpacking etc.tgz along the way.
- Use etcupdate to merge new changes to configuration files.
- Use postinstall to validate the upgraded system.
Machines are made to automate trivial and repetitive tasks like the above, and they are actually very good at that. Over the years, I have performed NetBSD updates manually and later written crappy, unreliable scripts to do the upgrades for me. These scripts have never been reusable and they haven't dealt with error conditions gracefully. Furthermore, because these scripts live in my home directory, I have to remember to carry them around every time I set up a new NetBSD box.
It was about time I sat down and rewrote my custom scripts into something more "decent". Something with documentation, with a configuration file, and with tests.
So today, and for all the reason above, I am introducing sysupgrade.
sysupgrade is a script that automates (trivializes) the whole process of upgrading an existing NetBSD installation to a newer release, be it the currently-running system or a non-live system. sysupgrade does so by following the steps outlined above and is coordinated by a configuration file. You can find the tool in pkgsrc/sysutils/sysupgrade, next to sysbuild. The bundled sysupgrade(8) and sysupgrade.conf(5) manual pages, and the default sysupgrade.conf configuration file should get you started and hopefully answer most of your questions.
For the impatient, the following command would upgrade your machine to the specified version target:
$ sysupgrade auto \
At the moment, please consider sysupgrade to be experimental. It works well for me on my various machines (running both NetBSD 6.0 BETA and -current), and I have been using the upgrade procedure outlined above for years without issues. However, as with any shiny-new software, be careful. If you use NetBSD on a virtual machine, take a snapshot before running this tool; I don't think your machine is going to blow up, but better safe than sorry!
Enjoy, and feedback very welcome!
PS: There is lots of room for improvement. The TODO file in the package directory includes some of the ideas I'd like to work on later.