Update major version

This chapter describes how to update a major version from TwinCAT/BSD 12 to TwinCAT/BSD 13, for example. The current major version is required for security updates, among other things.

The update is carried out with the aid of a script, because the entire basic system as well as the kernel adapted by Beckhoff is updated. The script also automatically creates a restore point that you can jump back to (see: Resetting to the restore point).

Proceed as follows:

1. Update the latest major version with doas pkg update -f && doas pkg upgrade.
2. Install the script for the update with the command doas pkg install tcbsd-upgrade
3. Execute the script with the command doas tcbsd-upgrade major. At the end of the process, a message about a successful update to the next major version is displayed.
Successfully upgraded to TC/BSD 13 and activated the new BE "upgrade-2022-02-17T15:02:01Z"
Reboot is required.
4. Restart TwinCAT/BSD with shutdown -r now after a successful update.
After the restart, the new major version is available and displayed after the login.
Last login: Thu Feb 17 15:07:47 on pts/0
FreeBSD 13.0-RELEASE-p7 n244930-e4e6bcfbb68- BHF

The software licenses can be found in this folder: /usr/local/etc/TwinCAT/3.1/System/Legal/
TcOsSys.dll: TcOsSys_Rel31_4024_20211129.2
TwinCAT Build: 3.1.4024.22
AMS Net Id: 5.61.105.18.1.1
TC/BSD: 13.0.7.2,2

Adaptation of the boot environment

The upgrade is installed in a new boot environment. A boot environment is a ZFS file system that can be booted into. The old ZFS file system is therefore still available and can be used as a backup in case of emergency. You can always select the boot environment you want to boot into from the bootloader menu and the "Boot Environments" menu item (press the space bar while booting).

To remove the old boot environment and free the system from legacy issues, the following procedure is recommended after a successful upgrade:

  1. Delete the restore point that is automatically created before the upgrade to the new major version. This also serves as a further fallback. Enter the command doas restorepoint destroy.
  2. Select the restore point upgrade-backup-<your timestamp> from the menu to delete it.
  3. Delete old boot environment (default) with bectl destroy default
  4. Rename the new boot environment to default with bectl rename upgrade-<timestamp> default. There must always be a "default" boot environment so that the restore point factoryreset can work.

Notice : The boot environment restore must not be deleted.