OpenBSD Upgrade 6.8 To 6.9
Tags: openbsd, os, upgrade, server
Published: 2021-05-03 11:04:03

## Summary

Next [OpenBSD](https://www.openbsd.org/) release, [6.9](https://www.openbsd.org/69.html), has been published on 1 May 2021✨

{% twitter 1388289402934333444 %}

<center>[What's New]
(https://www.openbsd.org/69.html#new)</center>
<br>

The 6.9 Song is "Vetera Novis", which means "old new" in Latin.

Almost all what to do is thankfully managed by [`sysupgrade`](https://man.openbsd.org/sysupgrade) (which appeared in 6.6) and its automatic process.

In this upgrade, [PostgreSQL](https://www.postgresql.org/)'s major version is updated from 12 (12.6) to 13 (13.2), which requires migration with [`pg_dumpall`](https://www.postgresql.org/docs/12/app-pg-dumpall.html) or [`pg_upgrade`](https://www.postgresql.org/docs/12/pgupgrade.html).

---

## Tutorial

Here is a step-by-step guide for the upgrade with a set of the commands to run.

1. Pre-upgrade
2. Upgrade
3. Post-upgrade
4. Follow configuration changes
5. Remove old files
6. Special packages

<center>🌼 🦔 🌼</center>

### 1. Pre-upgrade

```console
$ # validate available disk size of /usr is greater than 1.1GB
$ df -h
```

### 2. Upgrade

```console
$ doas sysupgrade
```

Then, it printed like this:

```console
Fetching from https://cdn.openbsd.org/pub/OpenBSD/6.9/amd64/
SHA256.sig   100% |**************************************************|  2144       00:00    
Signature Verified
INSTALL.amd64 100% |*************************************************| 43523       00:00    
base69.tgz   100% |**************************************************|   291 MB    00:11    
bsd          100% |**************************************************| 20423 KB    00:02    
bsd.mp       100% |**************************************************| 20515 KB    00:02    
bsd.rd       100% |**************************************************|  4107 KB    00:00    
comp69.tgz   100% |**************************************************| 85958 KB    00:05    
game69.tgz   100% |**************************************************|  2741 KB    00:00    
man69.tgz    100% |**************************************************|  7560 KB    00:01    
xbase69.tgz  100% |**************************************************| 29789 KB    00:02    
xfont69.tgz  100% |**************************************************| 39342 KB    00:03    
xserv69.tgz  100% |**************************************************| 18351 KB    00:02    
xshare69.tgz 100% |**************************************************|  4502 KB    00:00    
Verifying sets.
Fetching updated firmware.
Upgrading.
```

It rebooted the machine automatically, and the `sysupgrade` process continued.
After all, the login message was shown, saying "OpenBSD 6.9 (GENERIC)".

### 3. Post-upgrade

#### 3-1. `sysmerge`

```console
$ doas sysmerge
```

`rc.sysmerge` ran automatically in the previous process. But running this command may be necessary.
It sometimes requires merging conf files such as:

- `/etc/fstab`
- `/etc/mail/smtpd.conf`
- `/etc/pf.conf`
- `/etc/login.conf`

In each merging, these options (and more) are shown:

- `i`: to overwrite with new file.
- `d`: to preserve current file.
- `m`: to merge these two files manually.

In my case, merging `/etc/login.conf` was necessary in a server which used [`Dovecot`](https://www.dovecot.org/).

#### 3-2. `syspatch`

`sysupgrade` also ran this command and printed was "`syspatch: Error retrieving https://cdn.openbsd.org/pub/OpenBSD/syspatch/6.9/amd64/SHA256.sig: 404 Not Found`".
As of it, it might not be necessary:

```console
$ # doas syspatch
```

#### 3-3. Update packages

```console
$ doas pkg_add -u
```

What to do after `pkg_add -u` is due to servers. For example, in one of my servers, running `doas crontab -u _mailman /usr/local/lib/mailman/cron/crontab.in` was required to update `/var/cron/tabs/_mailman`.

If `postgresql-server` is used, confirmation to proceed is shown. Enter "n" to update it later following the official tutorial in `/usr/local/share/doc/pkg-readmes/postgresql-server`.

#### 3-4. Reboot

```console
$ doas reboot
$ # Almost done!
```

### 4. Follow configuration changes

Check [the documentation](https://www.openbsd.org/faq/upgrade69.html#ConfigChanges) if you use some of:

- [hostname.if(5)](https://man.openbsd.org/hostname.if.5)
- [iked.conf(5)](https://man.openbsd.org/iked.conf.5)
- [pf(4)](https://man.openbsd.org/pf.4)
- [pf.conf(5)](https://man.openbsd.org/pf.conf.5)
- [smtpd.conf(5)](https://man.openbsd.org/smtpd.conf.5)
- [snmpd.conf(5)](https://man.openbsd.org/snmpd.conf.5)
- [video(4)](https://man.openbsd.org/video.4)

### 5. Remove old files

```console
$ doas rm -f /usr/bin/podselect \
          /usr/lib/libperl.so.20.0 \
          /usr/libdata/perl5/*/CORE/dquote_inline.h \
          /usr/libdata/perl5/*/Tie \
          /usr/libdata/perl5/*/auto/Tie \
          /usr/libdata/perl5/Pod/Find.pm \
          /usr/libdata/perl5/Pod/InputObjects.pm \
          /usr/libdata/perl5/Pod/ParseUtils.pm \
          /usr/libdata/perl5/Pod/Parser.pm \
          /usr/libdata/perl5/Pod/PlainText.pm \
          /usr/libdata/perl5/Pod/Select.pm \
          /usr/libdata/perl5/pod/perlce.pod \
          /usr/libdata/perl5/unicore/Heavy.pl \
          /usr/libdata/perl5/unicore/lib/Lb/EB.pl \
          /usr/libdata/perl5/unicore/lib/Perl/_PerlNon.pl \
          /usr/libdata/perl5/unicore/lib/Sc/Armn.pl \
          /usr/libdata/perl5/utf8_heavy.pl \
          /usr/share/man/man1/podselect.1 \
          /usr/share/man/man3p/Pod::Find.3p \
          /usr/share/man/man3p/Pod::InputObjects.3p \
          /usr/share/man/man3p/Pod::ParseUtils.3p \
          /usr/share/man/man3p/Pod::Parser.3p \
          /usr/share/man/man3p/Pod::PlainText.3p \
          /usr/share/man/man3p/Pod::Select.3p
```

The description is [here](https://www.openbsd.org/faq/upgrade69.html#RmFiles).

### 6. Special packages

Check [the documentaion](https://www.openbsd.org/faq/upgrade69.html#SpecialPackages) if you use some of:

- databases/postgresql
- games/multimc
- security/yubiserve
- www/rt

In my case, I had to modify `/var/postgresql/data/postgresql.conf` to enable TLS connection:

```diff
  #listen_addresses = 'localhost' ...
+ listen_addresses = '*'

...

  #ssl = off
+ ssl = on
```

Reference to PostgreSQL and TLS connection:

{% link nabbisen/postgresql-tls-connection-k1h %}

---

With gratitude to the OpenBSD project and community.