.\"	$NetBSD: upgrade,v 1.30 2015/05/09 08:13:35 snj Exp $
.\"
.\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.
.
.Pp
The easiest way to upgrade to
.Nx
\*V
is with binaries, and that is the method documented here.
.Pp
.ie \n[atari] \{\
To do the upgrade, you must first boot the system as described in the
.Sx Booting the installer
section.
.\}
.el \{\
.ie \n[mac68k]:\n[macppc]:\n[sparc]:\n[sparc64] \{\
To do the upgrade, you must boot the install kernel using one of
the methods described above.
.\}
.el \{\
.ie \n[pmax] \{\
To do the upgrade, you must install new bootblocks and boot off
the
.Ic install
kernel as described in the
.Sx Installing from an existing system
section.
.\}
.el \{\
.ie \n[x68k] \{\
As noted above, you must have the
.Pa loadbsd.x
utility and the installation kernel you chose, or the
boot floppies available to do the upgrade.
.\}
.el \{\
To do the upgrade, you must have one form of boot media available.
.\}\}\}\}
You must also have at least the
.Sy base
and
.Sy kern
binary distribution sets available.
Finally, you must have sufficient disk space available to install the
new binaries.
Since files already installed on the system are overwritten in place,
you only need additional free space for files which weren't previously
installed or to account for growth of the sets between releases.
.Pp
Since upgrading involves replacing the kernel, boot blocks,
and most of the system binaries, it has the
potential to cause data loss.
You are strongly advised to 
.Em back up 
any important data on the
.Nx
partition or on
another operating system's partition on your disk
before beginning the upgrade process.
.if \n[macppc] \{\
Since installation of the bootloader will prevent
.Tn Mac OS
from using the disk and will prevent Open Firmware 3 machines from
booting, there is an option to bypass this step.
Make sure you know whether or not to install the bootloader.
.\}
.Pp
The upgrade procedure
is similar to an installation, but without the hard disk partitioning.
.Pp
Fetching the binary sets is done in the same manner as the installation
procedure; refer to the installation part of the document for help.
File systems are checked before unpacking the sets.
.Pp
After a new kernel has been copied to your hard disk, your
machine is a complete
.Nx
\*V
system.
However, that doesn't mean that you're finished with the upgrade process.
You will probably want to update the set of device nodes you have in
.Pa /dev .
If you've changed the contents of
.Pa /dev
by hand, you will need to be careful about this, but if
not, you can just cd into
.Pa /dev ,
and run the command:
.Pp
.Dl # Ic "sh MAKEDEV all"
.Pp
.Ic sysinst
will attempt to merge the settings stored in your
.Pa /etc
directory with the new version of
.Nx
using the
.Xr postinstall 8
utility.
However,
.Xr postinstall 8
is only able to deal with changes that are easily automated.
It is recommended that you use the
.Xr etcupdate 8
tool to merge any remaining configuration changes.
