Does anybody have a reference on how to deal with config files during a sysupgrade in #NetBSD? What do you replace, what do you keep, what do you merge?
@passthejoe There are a few ways to do it. The old way, "build release sets and unroll", isn't even in the manual any more. Note that unlike FreeBSD, NetBSD ships etc as a distinct set, so you don't have to unroll a fresh etc, as that *will* nuke you. That said, you need to then be aware of what changed - possibly file formats and whole new files if it's a major upgrade.
The install guide notes two newer ways to do it. Note that each of them handles /etc merges, but the first suggests running etcupdate, which you do explicitly with the second option.
@passthejoe I have a process that works OK for me:
1. cp -a /etc /root/etc-bkup-nov26
2. sysupgrade ...
3. use the built-in file upgrader (etcupdate), with decision logic as follows
4. is the file passwd, shadow, or group? DO NOT REPLACE (keep current version)
5. is this a file i modified or deleted by hand? do not replace (keep current version)
6. otherwise, go ahead and replace
I never try to "merge" files during this process. My rationale is that old configuration files will almost always still work, and if I do take a new file and things stop working I can either copy over my backup copy of that file or do a configuration merge later to get things working.
The biggest issue is that the tool makes it possible to accidentally blow away your new users/groups or your shell configuration which you've presumably edited. So my biggest priority is avoiding that.
@d6 Thanks for the info.
replace - anything that hasn't been edited (mtree files, etc)
keep - anything that has been edited (passwd file, rc.conf)
merge - reserve only for uncommon special situations, e.g. a new user/group is needed by a new daemon.
@washbear Thanks for all the responses in this thread. I'm going to do some more practice installs and upgrades.
I got lucky with my VPS, which is still running fine, but I did mess up a VM.
I especially like the idea of backing up /etc in case of trouble. I back up user files and should definitely go beyond /home in this case.
@passthejoe etc is usually automatically backed up in /var/backups/etc
I stumbled through OK on my VPS with a live web site (where I really took my time), but I did a VM install for practice and killed out /etc/passwd without thinking during a quick update from 11.0 to 11.1.