At some point, you might want to upgrade your NetBSD base system, be it due to a Security Advisory or just because you want to try the coming release.
Although, this is covered on Chapter 4 of the NetBSD-guide, I'm writing here a short walk through of the process as I usually do it.

You can either use sysinst or sysupgrade to do this. Actually, you can do it all manually if you wish but, I won't cover that option here, as this means you know what you are doing and won't be needing to read this 😉

Using sysupgrade is somewhat limited, quoting the Guide:

NOTE: upgrades across major binary releases might not work properly because of the lack of a reboot between the kernel installation and the unpacking of the sets.

so, I prefer to use sysinst to do the job. As an example, I'm upgrading my own system (9.0_RC1) using the images from the daily-builds. In fact, I'm upgrading within the same release but, the procedure is in all similar when updating across releases, with the exception that, you might need some adjustments in /etc afterwards.

HEADS-UP!!!
Any of the following may result in data loss! Back-up all important data before doing this!

Download the most recent image for your system, mine is amd64 and I'm using legacy boot.
Once you have downloaded the image, verify its integrity against the published sums, if the image sum matches, proceed with the unpacking

$ cd Downloads/                                                      
$ cksum -a MD5 NetBSD-9.0_RC1-amd64-install.img.gz  
MD5 (NetBSD-9.0_RC1-amd64-install.img.gz) = c89aaa14380d065bbba57424cc260a5b
$ gunzip NetBSD-9.0_RC1-amd64-install.img.gz

Attach an usb-device and check for its presence,

$ sysctl hw.disknames
hw.disknames = wd0 sd0
$ dmesg
...
[   885.151377] sd0 at scsibus0 target 0 lun 0: <Kingston, DataTraveler 3.0, PMAP> disk removable
[   885.161381] sd0: fabricating a geometry
[   885.161381] sd0: 14784 MB, 14784 cyl, 64 head, 32 sec, 512 bytes/sect x 30277632 sectors
[   885.161381] sd0: fabricating a geometry

Copy the unpacked image to your device using dd and shutdown the system

$ pwd
/home/pin/Downloads
$ doas dd if=NetBSD-9.0_RC1-amd64-install.img of=/dev/rsd0d bs=2m 
Password:
725+0 records in
725+0 records out
1520435200 bytes transferred in 66.967 secs (22704245 bytes/sec)
$ doas shutdown -p now

Time to boot from the install image and upgrade your machine!

Once you have booted the install media and picked your keyboard layout, choose option
>b: Upgrade NetBSD on a hard disk
Answer Yes to the next question and choose the target disk.

Proceed with choosing bootblocks
>a: Use BIOS console
followed by choosing the distribution filesets
>a: Full installation
Pick the source
>a: CD-ROM/DVD/install image media
...and let sysinst do its job 🙂

When prompted Hit enter to continue

Back at the start installation screen choose
>x: Exit Install System
At the bottom of your screen type
#shutdown -p now

Remove the install media, boot-up the machine... et voilà

    pin actually i prefer sysupgrade than sysinst for upgrading 🙂

    “Only the paranoid survive.”

    ― Harold Finch
    NetBSD VPS , NetBSD , OS108

    5 days later

    I feel this post will come in handy some day soon 🙂 Last time I used sysupgrade I had problems so I think I'll try sysinst next time.

    • Jay likes this.
    a month later

    Hm, upgrading to 9.0 did not go well. I should have checked that binary packages was available before I started. I got some errors in the process, iirc something about fontconfig and X11. And yes, Windowmaker is broken and wpa_supplicant behaves strange, turning on and sometimes off. While I can build everything myself with pkgsrc I will not choose that option at this point but reinstalling 8.1 and hold off on 9.0 for a while.

    • pin replied to this.

      el-topo you can pull binaries from Japan, that's what I'm doing, ...here
      The rest I can help you with, just not today 🙁
      Please, let me know, I've done this several times.

      EDIT: See if manually removing /etc/rc.d/dhclient and /etc/rc.d/isdnd solves your wpa_supplicant issues. These are no longer a part of the system in 9.0.
      Unrelated, add nvmm to /etc/group by adding nvmm:*:34:root to the list, this is also new.

      For the remaining issues you describe set-up the release source directories as described in Chapter 30 and use postinstall to correct these. postinstall check and postinstall fix are your friends and will tell you exactly what to do.

        Thanks for the tip. I pulled down binaries from ki.nu RC2 but quite a few packages were missing and now the Window Maker binary wmaker mysteriously disappeared from the system even though it looks like it installed? Very strange... I saw that you wrote about another ki.nu repo in the other thread, is there a problem switching to that branch when I already have RC2 packages on the system?

        • pin replied to this.
        • Jay likes this.

          el-topo is there a problem switching to that branch when I already have RC2 packages on the system?

          It shouldn't, I did just that a couple of hours ago, updated the system and everything is working.
          Actually, I've been doing this since 9.0_BETA which, in turn was originaly a 8.1_STABLE install.
          Remember that all these packages come from builds based on pkgsrc-current 😉

          Cool, I'm downloading right now and it's a much smoother ride. No errors so far 🙂

          • Jay likes this.

          It passes all postinstall checks now but X is still broken. I tried to generate a xorg.conf file but got an error saying that the number of displays does not match the number of screens. Which is strange because it finds two displays and two screens (there is just one screen attached to this laptop though). Any idea what can be wrong with this conf?

          Section "ServerLayout"
          	Identifier     "X.org Configured"
          	Screen      0  "Screen0" 0 0
          	Screen      1  "Screen1" RightOf "Screen0"
          	InputDevice    "Mouse0" "CorePointer"
          	InputDevice    "Keyboard0" "CoreKeyboard"
          EndSection
          
          Section "Files"
          	ModulePath   "/usr/X11R7/lib/modules"
          	FontPath     "/usr/X11R7/lib/X11/fonts/misc/"
          	FontPath     "/usr/X11R7/lib/X11/fonts/TTF/"
          	FontPath     "/usr/X11R7/lib/X11/fonts/Type1/"
          	FontPath     "/usr/X11R7/lib/X11/fonts/75dpi/"
          	FontPath     "/usr/X11R7/lib/X11/fonts/100dpi/"
          EndSection
          
          Section "Module"
          	Load  "dri"
          	Load  "dri2"
          	Load  "glx"
          	Load  "shadow"
          EndSection
          
          Section "InputDevice"
          	Identifier  "Keyboard0"
          	Driver      "kbd"
          EndSection
          
          Section "InputDevice"
          	Identifier  "Mouse0"
          	Driver      "mouse"
          	Option	    "Protocol" "wsmouse"
          	Option	    "Device" "/dev/wsmouse"
          	Option	    "ZAxisMapping" "4 5 6 7"
          EndSection
          
          Section "Monitor"
          	Identifier   "Monitor0"
          	VendorName   "Monitor Vendor"
          	ModelName    "Monitor Model"
          EndSection
          
          Section "Monitor"
          	Identifier   "Monitor1"
          	VendorName   "Monitor Vendor"
          	ModelName    "Monitor Model"
          EndSection
          
          Section "Device"
                  ### Available Driver options are:-
                  ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
                  ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
                  ### <percent>: "<f>%"
                  ### [arg]: arg optional
                  #Option     "Accel"              	# [<bool>]
                  #Option     "AccelMethod"        	# <str>
                  #Option     "Backlight"          	# <str>
                  #Option     "CustomEDID"         	# <str>
                  #Option     "DRI"                	# <str>
                  #Option     "Present"            	# [<bool>]
                  #Option     "ColorKey"           	# <i>
                  #Option     "VideoKey"           	# <i>
                  #Option     "Tiling"             	# [<bool>]
                  #Option     "LinearFramebuffer"  	# [<bool>]
                  #Option     "HWRotation"         	# [<bool>]
                  #Option     "VSync"              	# [<bool>]
                  #Option     "PageFlip"           	# [<bool>]
                  #Option     "SwapbuffersWait"    	# [<bool>]
                  #Option     "TripleBuffer"       	# [<bool>]
                  #Option     "XvPreferOverlay"    	# [<bool>]
                  #Option     "HotPlug"            	# [<bool>]
                  #Option     "ReprobeOutputs"     	# [<bool>]
                  #Option     "XvMC"               	# [<bool>]
                  #Option     "ZaphodHeads"        	# <str>
                  #Option     "VirtualHeads"       	# <i>
                  #Option     "TearFree"           	# [<bool>]
                  #Option     "PerCrtcPixmaps"     	# [<bool>]
                  #Option     "FallbackDebug"      	# [<bool>]
                  #Option     "DebugFlushBatches"  	# [<bool>]
                  #Option     "DebugFlushCaches"   	# [<bool>]
                  #Option     "DebugWait"          	# [<bool>]
                  #Option     "BufferCache"        	# [<bool>]
          	Identifier  "Card0"
          	Driver      "intel"
          	BusID       "PCI:0:2:0"
          EndSection
          
          Section "Device"
                  ### Available Driver options are:-
                  ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
                  ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
                  ### <percent>: "<f>%"
                  ### [arg]: arg optional
                  #Option     "Accel"              	# [<bool>]
                  #Option     "AccelMethod"        	# <str>
                  #Option     "Backlight"          	# <str>
                  #Option     "CustomEDID"         	# <str>
                  #Option     "DRI"                	# <str>
                  #Option     "Present"            	# [<bool>]
                  #Option     "ColorKey"           	# <i>
                  #Option     "VideoKey"           	# <i>
                  #Option     "Tiling"             	# [<bool>]
                  #Option     "LinearFramebuffer"  	# [<bool>]
                  #Option     "HWRotation"         	# [<bool>]
                  #Option     "VSync"              	# [<bool>]
                  #Option     "PageFlip"           	# [<bool>]
                  #Option     "SwapbuffersWait"    	# [<bool>]
                  #Option     "TripleBuffer"       	# [<bool>]
                  #Option     "XvPreferOverlay"    	# [<bool>]
                  #Option     "HotPlug"            	# [<bool>]
                  #Option     "ReprobeOutputs"     	# [<bool>]
                  #Option     "XvMC"               	# [<bool>]
                  #Option     "ZaphodHeads"        	# <str>
                  #Option     "VirtualHeads"       	# <i>
                  #Option     "TearFree"           	# [<bool>]
                  #Option     "PerCrtcPixmaps"     	# [<bool>]
                  #Option     "FallbackDebug"      	# [<bool>]
                  #Option     "DebugFlushBatches"  	# [<bool>]
                  #Option     "DebugFlushCaches"   	# [<bool>]
                  #Option     "DebugWait"          	# [<bool>]
                  #Option     "BufferCache"        	# [<bool>]
          	Identifier  "Card1"
          	Driver      "intel"
          	BusID       "PCI:0:2:1"
          EndSection
          
          Section "Screen"
          	Identifier "Screen0"
          	Device     "Card0"
          	Monitor    "Monitor0"
          	SubSection "Display"
          		Viewport   0 0
          		Depth     1
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     4
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     8
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     15
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     16
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     24
          	EndSubSection
          EndSection
          
          Section "Screen"
          	Identifier "Screen1"
          	Device     "Card1"
          	Monitor    "Monitor1"
          	SubSection "Display"
          		Viewport   0 0
          		Depth     1
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     4
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     8
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     15
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     16
          	EndSubSection
          	SubSection "Display"
          		Viewport   0 0
          		Depth     24
          	EndSubSection
          EndSection
          • pin replied to this.

            el-topo I'd have to check, I've never had to created a xorg.conf. I can check tomorrow 😴
            Although this (at the start of your file) looks suspicious.

            Screen      0  "Screen0" 0 0
            Screen      1  "Screen1" RightOf "Screen0"

              pin Yeah, I thought so too. I tried removing this and doing various combinations with or without the double display/screen sections but with no effect.

              • pin replied to this.

                el-topo Just checked my system, I don't have a xorg.conf or xorg.conf.d anywhere and everything is working fine 😉
                You probably know this already but have a look at section 9.2 of the guide

                Here's what I would do...

                # cd /etc/X11
                # mv xorg.conf old.conf
                # exit
                $ startx

                If this works, you don't need xorg.conf and you can delete the file. If not,

                # X -configure
                # mv /home/${USER}/xorg.conf.new /etc/X11/xorg.conf
                # exit
                $ startx

                You can now check where the issue was using

                $ cd /etc/X11
                $ diff xorg.conf old.conf
                • Jay likes this.

                I see. Well, it doesn't work with or without for me so I guess it's time to admit defeat and start over because I'm all out of ideas 🙁 Thanks for helping out.

                • pin replied to this.

                  el-topo did you see my edit? Did you try creating a new one?

                    pin Yes I created a new one because there wasn't any and I thought that was the issue. So the one I posted above was the new one I got from X -configure. It seems the issue is something else, something that made the upgrade of the X11 portion with sysinst crash in the first place.

                    • pin replied to this.

                      el-topo you could try to manually remove X11 and try again. But, something seems to be broken, that's why I keep updated copies of all my config files in a git repo.
                      When/If something goes wrong, just reinstall, install git-base and pull everything into place.

                        pin Hm, that is not something I can do with pkgin right?

                        • pin replied to this.

                          el-topo Actually, its possible. See here and here

                          You would need to package the target files and host them together with a pkg_summary.
                          Then, you can declare the repo-url in repositories.conf and use pkgin to install them as any other package.
                          Heads-up, its quite a bit of work but, possible 😉

                          • Jay likes this.
                          4 days later

                          I'm beginning to think there is something wrong with that machine. I installed NetBSD/i386 9.0 on a different machine and I don't get the same behavior there with X and icewm. You don't know of any place with binary packages for i386 do you? 🙂 I have the system going with some 8.0 packages and some hackish symlinks but that feels like it may fail real soon.

                          • pin replied to this.

                            el-topo Nope 🙁
                            The binaries for amd64 were a gift from Makoto Fujiwara, for i386 you will have to wait for the official builds by Manuel Bouyer.
                            Symlink hacks are always a risk.