# FreeBSD 15.1 migration for TrueNAS CORE

Status: researched implementation plan, 2026-09-12. No modified ISO or upgrade
image has been built or tested yet.

Progress update (2026-09-12): the source inputs are now downloaded and
checksum-verified, and a package-only FreeBSD 15.1 bootstrap prototype has
been assembled and booted. The manual-update artifact itself is not yet a
valid 15.1 upgrade; remaining work is to integrate the TrueNAS application
layer, generate a legacy package manifest, and prove the result in a disposable
VM.

## Completion ledger

Record each completed milestone with UTC time and its Fossil check-in. A checked
box without an entry here is not treated as release evidence.

| UTC completion time | Completed item | Fossil check-in |
| --- | --- | --- |
| 2026-09-12 09:05 | Assemble the FreeBSD 15.1 pkgbase root and package lock | `6418a97a7351` |
| 2026-09-12 09:16 | Boot the package-built root in QEMU and begin guest installation | `6418a97a7351` |
| 2026-09-12 15:08 | Guest reports 15.1 for kernel, userland and running versions | `6418a97a7351` |
| 2026-09-12 15:18 | Add the MVP acceptance checklist | `148ce91ac6d8` |
| 2026-09-12 15:37 | Build and structurally validate the unsigned 15.1 manual-update archive | `8dbf0155c24d` |
| 2026-09-12 15:38 | Write the release SHA256 sidecar for the validated archive | `edd517166bec` |
| 2026-09-12 15:48 | Rebuild with complete directory inventory and validate the v2 archive at gzip level 1 | `7061f62ca987` |
| 2026-09-12 15:50 | Add configurable gzip compression for faster disposable test builds | `049e69ef4bdc` |
| 2026-09-12 15:49 | Parse the v2 outer manifest with the shipped CORE freenasOS Manifest class | `27cba3a810fa` |
| 2026-09-12 15:50 | Document experimental migration prerequisites, procedure, limitations and recovery | `69f8649f5e3e` |
| 2026-09-12 15:52 | Acquire and checksum FreeBSD 15.1 compat13x/compat14x packages for runtime testing | `cf0a0efcfad5` |
| 2026-09-12 16:05 | Assess published zVault manual-update archive and CORE cross-grade support | `36ff43f1e720` |
| 2026-09-12 16:09 | Build and structurally validate compat-enabled v4 manual-update candidate | `aeb29c4115d3` |
| 2026-09-12 16:13 | Define native 15.1 pkg.freebsd.org post-bootstrap upgrade policy | `25f0bb0f6bcd` |
| 2026-09-12 16:14 | Add reusable verifier and validate unsigned v2 plus compat v4 archives | `d70b2bf82665` |

The manual-update package build and structural validation completed at the
timestamp recorded above. Runtime updater acceptance and NAS behavior remain
unproven.

## MVP checklist: CORE system upgrade to FreeBSD 15.1

The MVP means a tested migration of one supported TrueNAS CORE release into a
new boot environment whose kernel and base userland are FreeBSD 15.1, while the
TrueNAS middleware, configuration and basic NAS operations still work. An item
is complete only when its evidence is recorded in `TEST-RESULTS.md`.

### Inputs and reproducibility

- [x] (09:05) Obtain a real CORE ISO and matching manual-update archive.
- [x] (09:05) Verify and record publisher checksums for all external inputs.
- [x] (09:05) Obtain the official FreeBSD 15.1 amd64 pkgbase repository and verify its checksum.
- [x] (09:05) Record exact source URLs, package versions and hashes in `inputs.json` and a package lock.
- [ ] Pin a reproducible set of non-base binary packages needed by the TrueNAS layer.

### 15.1 target root

- [x] (09:05) Assemble the complete `FreeBSD-set-base` dependency closure from 15.1 packages.
- [x] (09:05) Include the 15.1 GENERIC kernel, modules, loaders and boot files.
- [x] (09:16) Boot the assembled root in a disposable VM under the 15.1 kernel.
- [x] (15:08) Run the native package transaction inside the 15.1 VM rather than under the old kernel.
- [ ] Preserve the guest's completed native pkg database and package cache in the target root.
- [ ] Add only explicitly tested compatibility libraries for retained CORE binaries.
- [ ] Produce a clean target root without bootstrap-only rc scripts, network settings or test files.

### TrueNAS behavior

- [ ] Inventory the selected CORE release's middleware, web UI, Python interpreter and native extensions.
- [ ] Overlay or rebuild the TrueNAS application layer without replacing 15.1 `/bin`, `/sbin`, `/lib`, `/usr/bin` or `/usr/sbin`.
- [ ] Make all required middleware imports succeed on 15.1.
- [ ] Start middleware and web services on the target root and verify web login.
- [ ] Preserve configuration schema, account IDs, network settings, services and tunables.
- [ ] Verify ZFS CLI, libraries, Python bindings and kernel interfaces as one compatible set.
- [ ] Verify at least ZFS pool import, dataset access, snapshot, scrub and basic SMB/NFS I/O.
- [ ] Explicitly document unsupported jails, plugins, directory services, iSCSI or hardware integrations.

### Manual-update artifact

- [ ] Confirm the selected CORE updater accepts the fork's manifest schema and trust policy without globally disabling verification.
- [x] (15:48) Generate a legacy `base-os` package containing the complete staged 15.1 target root and valid file hashes.
- [ ] Reconcile old package ownership/removals with the native 15.1 pkg database; remove obsolete 13.x base files.
- [x] (15:48) Regenerate the outer `MANIFEST` with a distinct version, sequence, train, sizes and checksums.
- [ ] Include required updater tools and validators compatible with the target release.
- [x] (15:48) Create a flat outer `*-manual-update.tar` with the expected four-member layout.
- [x] (15:48) Validate outer package sizes/checksums and inspect the inner package manifest and archive paths.
- [ ] Keep the artifact clearly marked experimental and unsigned until the fork's signing/trust process exists.

### VM migration and recovery

- [ ] Snapshot a disposable CORE VM with a configuration export and separate test data pool.
- [ ] Apply the manual update through the CORE web/manual-update path, if accepted.
- [ ] Otherwise boot 15.1 migration media and populate an inactive destination boot environment offline.
- [ ] Inspect the destination boot environment before activation and prove no partial activation is possible.
- [ ] Boot BIOS and UEFI variants as applicable and verify `freebsd-version -kru` reports 15.1.
- [ ] Verify middleware startup, web login, configuration save/reboot and network persistence after migration.
- [ ] Verify the test data pool imports without automatic pool-feature upgrades.
- [ ] Activate the old boot environment and prove rollback restores service access and configuration.
- [ ] Test an interrupted or failed migration and document console recovery steps.

### MVP release gate

- [x] (15:48) Produce `out/TrueNAS-15.1-pkgbase-manual-update-unsigned-v2.tar` and its SHA256 file.
- [ ] Produce `MIGRATION.md` with prerequisites, supported source version, exact procedure, limitations and recovery.
- [ ] Produce `TEST-RESULTS.md` containing command output and VM evidence for every checked gate above.
- [ ] Do not call the MVP complete while any required TrueNAS behavior, package ownership, boot path or rollback evidence is missing.

Project objective: provide users of existing FreeBSD-based TrueNAS CORE and
zVault installations a migration to an appliance running FreeBSD 15.1, assembled
from binary packages, while preserving NAS configuration and data. Use Fossil
SCM for all new project work.

## Recommendation

Start by inventorying a representative stock TrueNAS CORE installation and
constructing a FreeBSD 15.1 root from official binary packages in a separate
staging environment. Determine how to retain its NAS functionality and
configuration, then select the simplest verified way to apply that root to an
inactive boot environment: a manual-update wrapper or bootable migration media.

zVault is an optional reference, component donor or test source. It may help
with middleware changes or packaging, but neither adopting zVault nor migrating
through a zVault release is a prerequisite. Evaluate its usefulness against
the direct CORE path before depending on it. Retain the research below as
evidence about that candidate, not as proof of stock CORE compatibility.

TrueNAS CORE/zVault does have an appliance-style offline upgrade facility:
upload a manual update file and install the replacement system in a new ZFS
boot environment. This serves the requested purpose, although its format is
a manifest plus filesystem packages, not a raw embedded disk image. The
CORE documentation describes manual updates and boot-environment recovery.
[Manual updates](https://www.truenas.com/docs/core/13.3/coretutorials/updatingtruenas/),
[boot environments](https://www.truenas.com/docs/core/13.3/coretutorials/systemconfiguration/managingbootenvironments/).

The update route avoids rebuilding the installer's boot filesystem, EFI image,
and ISO initially. It does **not** avoid the main porting problem: the retained
middleware and appliance integrations must run against stock FreeBSD 15.1.

| Route | Work specific to delivery | Proposed role |
| --- | --- | --- |
| Manual-update tarball | Legacy package/manifest wrapper, new boot environment, migration and rollback | Candidate first delivery path, conditional on source compatibility |
| 15.1 migration media | Boot new kernel, mount destination, populate new boot environment | Independent delivery path if the old updater cannot bridge the release |
| Retrofitted appliance ISO | Same installed payload plus 15.1 installer runtime and BIOS/UEFI/hybrid packaging | Optional reuse if an existing installer reduces the work |

## Scope and meaning of “packages only”

The kernel, kernel modules, boot files and base userland must come from official
FreeBSD 15.1 pkgbase packages. Ordinary third-party dependencies must come from
compatible FreeBSD binary packages. Do not run buildworld, buildkernel, ports
builds, or compile native dependencies to fill gaps.

Repackaging existing binaries and adapting shell/Python integration code is
allowed by this design; it does not require compiling FreeBSD. Inventory the
existing CORE application/UI assets and configuration templates, identifying
what can be retained. Evaluate zVault equivalents only where useful. Any
retained or replacement appliance layer eventually needs its own package.

There is an important feasibility boundary: “no compilation; reuse appliance
assets and FreeBSD packages” may be achievable, but “every component comes
exclusively from the official FreeBSD repositories” is not established. CORE
ships custom middleware and dependencies. If a necessary native component has
no compatible binary package, record it as a blocker or replace the integration
with an available interface. Do not silently retain an incompatible binary or
introduce a source build. A base-only prototype is a milestone, not a working
NAS release.

### Post-bootstrap package policy

Once the FreeBSD 15.1 kernel and base userland boot successfully, all ordinary
package installation and upgrades must run natively under that 15.1 system
using a pinned `pkg.freebsd.org` repository snapshot and its signed metadata.
The old CORE appliance package database is not a source for upgrading FreeBSD
components. Preserve the native 15.1 pkg database and cache in the destination
boot environment, record the exact repository and package lock, and abort on
repository ABI or signature mismatch.
NAS release.

## Findings and evidence

### Optional zVault release inputs

The download linked by zvault.io is the following prerelease:

- ISO: `zVault-13.3-MASTER-202505042329-ca844f8808.iso` (989,433,856 bytes).
- ISO checksum: the same filename followed by `.sha256`.
- Upgrade: `zVault-13.3-MASTER-202505042329-manual-update-unsigned.tar`
  (854,483,456 bytes).

[Release and downloads](https://github.com/zvaultio/Community/releases/tag/zVault-13.3-MASTER-202505042329-ca844f8808).

The workspace was initially empty, and no zVault ISO was found in the home
directory or temporary directories searched. A download attempt failed with
DNS resolution errors; the actual archive contents have not been inspected.
The findings below are from release metadata and upstream code, and must be
checked against the selected release's shipped files before implementation.

#### CORE to zVault assessment (2026-09-12)

The zVault Community repository publishes
`zVault-13.3-MASTER-202505042329-manual-update-unsigned.tar` (854,483,456
bytes) alongside its ISO. This confirms that zVault uses the same general
freenasOS manual-update shape. No release documentation or updater contract
was found that promises a supported cross-grade from stock TrueNAS CORE to
zVault; both projects' application package ownership, train names, signatures,
and configuration migrations must be treated as fork-specific. The archive is
therefore useful as a format and middleware reference, not as evidence that a
CORE installation can safely consume it or that it provides a newer FreeBSD
base. The published zVault release is itself 13.3-based.

### Current workspace artifacts and verification

The ignored `downloads/` directory contains the TrueNAS 13.3-U1.2 ISO and
manual update plus the FreeBSD 15.1 pkgbase repository. Their SHA256 values
match the published values recorded in `inputs.json`:

| Input | SHA256 | Result |
| --- | --- | --- |
| `TrueNAS-13.3-U1.2-manual-update.tar` | `32d12ea9120416a32c375dddeff3e4452fb391646b1c5ffba7ae39a99886397f` | Published checksum matches |
| `TrueNAS-13.3-U1.2.iso` | `9810e0a64c0460485a3150e90660bfc1442033ca88b9f00d3d761b1bd7848db1` | Published checksum matches |
| `FreeBSD-15.1-RELEASE-amd64-pkgbase-repo.tar` | `d6313e25d1180af552686fbb6a5690e6f35482c8f2bc12e0cadb40b14a2c8df3` | FreeBSD published checksum matches |

The CORE update archive was extracted and contains `MANIFEST`, the 852,036,461
byte `base-os` payload, `freebsd-pkgdb`, `freenas-pkg-tools`, `ValidateUpdate`,
and `ChangeLog.txt`. Its manifest has three packages and requires a reboot for
`base-os`.

The FreeBSD repository was extracted locally. `bootstrap-vm.py` selected the
complete `FreeBSD-set-base` dependency closure plus `FreeBSD-kernel-generic`,
recorded 213 exact package hashes in `work/base-packages.lock.json`, and
produced a 468 MiB staged root and an 8 GiB GPT/UFS bootstrap disk. The root
contains 15.1 boot files and kernel packages; it is not the final TrueNAS image.

That bootstrap disk has been started in QEMU. Its guest script is installing
the native 15.1 package set under the 15.1 kernel. Guest completion,
`freebsd-version -kru`, package database state, and middleware tests are still
required before this becomes upgrade evidence. The first full guest transaction
has now completed: the VM reported `15.1-RELEASE` for kernel, userland and
running versions, and printed `CORE151: native package installation complete`.
The guest was then stopped; the package count and middleware startup have not
yet been captured.

`audit-elf.py` scanned 2,797 dynamic ELF files in the staged base and extracted
CORE tree. Retained CORE binaries reference 13.x-era libraries including
`libssl.so.111`, `libcrypto.so.111`, Heimdal 11 libraries and `libutil.so.9`.
This filename-level report demonstrates why copying the old CORE `/usr/local`
into a 15.1 root is unsafe; compatible packages or explicitly tested
compatibility libraries are required.

The first unprivileged `pkg-static -r` staging attempt failed because pkg needs
privileges to register/install packages. Package installation was moved into
the disposable QEMU guest. No host package database or host system files were
modified.

New repeatable tooling now exists in `scripts/`: `bootstrap-vm.py` builds the
package-only bootstrap disk, `guest-bootstrap.sh` performs the privileged
native package transaction inside the VM, `artifact-server.py` safely receives
large guest-created artifacts without overwriting an existing output, and
`audit-elf.py` performs a non-executing ELF dependency inventory. These tools
are development scaffolding and do not yet create the CORE manual-update
format.

The build host is amd64 FreeBSD `15.1-RELEASE-p1`; `pkg`, `bsdtar`, `makefs`,
`mkimg`, and QEMU are present. Its configured base repository is
`pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1`, with fingerprints
in `/usr/share/keys/pkgbase-15`. These are observations, not permission to
change the host's packages or use its live filesystem as a build destination.

FreeBSD publishes 15.1 binary base packages, including a downloadable pkgbase
repository archive. Pin a specific package snapshot and its checksums; a release
repository URL alone is not reproducible because it receives updates.
[15.1 release announcement](https://www.freebsd.org/releases/15.1R/announce/),
[pkgbase documentation](https://docs.freebsd.org/en/books/handbook/cutting-edge/#pkgbase).

### Update mechanism observed in zVault sources

Confirm these findings against the selected CORE release before using them
to design its update wrapper. Shared ancestry does not prove identical behavior.

The build script `create-upgrade-distribution.py` copies the appliance packages
and renames the product manifest to `MANIFEST`. It flattens the package files
into the tarball's top level, using `tar -C staging -cf output .`.

The updater's `ExtractFrozenUpdate()` accepts members with a leading `./` and
one filename component. Preserve this detail: an arbitrary nested repository
tree will not work as a replacement manual-update archive. `ApplyUpdate()`
loads and validates the manifest, compares packages, creates/mounts a clone
for updates requiring reboot, installs packages there, saves the manifest and
activates the new boot environment.

The inner packages have a JSON `+MANIFEST`, file hashes and installation scripts.
They are processed by Python `freenasOS`, with an appliance package database at
`/data/pkgdb/freenas-db`. This is separate from FreeBSD pkg's database. Modern
FreeBSD `.pkg` files cannot simply replace the old payloads by renaming them.

Source snapshots reviewed:

- [Upgrade archive builder](https://github.com/zvaultio/zvio-build/blob/f1e079cdfb9845a562b59f131f4a70aeda215bbe/build/tools/create-upgrade-distribution.py).
- [Update extraction and boot-environment application](https://github.com/zvaultio/zvio-pkgtools/blob/294a2ced502b5af6cce18abf76b8cf19b4b590cb/lib/Update.py).
- [Legacy package installation and deferred scripts](https://github.com/zvaultio/zvio-pkgtools/blob/294a2ced502b5af6cce18abf76b8cf19b4b590cb/lib/Installer.py).
- [Appliance package database](https://github.com/zvaultio/zvio-pkgtools/blob/294a2ced502b5af6cce18abf76b8cf19b4b590cb/lib/Configuration.py).

Signature acceptance requires a release-specific check. The published archive
is named `unsigned`, but `ApplyUpdate()` requests signature validation, and
`Manifest.Validate()` also consults update-server policy and global settings.
Do not infer either universal rejection or universal acceptance from the
filename. Inspect the shipped policy and test an unchanged archive first.
Modified manifests cannot retain a valid upstream signature. A distributable
fork needs its own trust configuration; an unchanged TrueNAS installation is
not automatically an eligible recipient.
[Manifest validation](https://github.com/zvaultio/zvio-pkgtools/blob/294a2ced502b5af6cce18abf76b8cf19b4b590cb/lib/Manifest.py).

### ISO mechanism observed in zVault sources

The ISO builder creates `data/base.ufs.uzip` for the installer runtime, keeps
boot files/kernel on the ISO, and includes a product manifest plus appliance
packages for the installed system. Its `.mount.conf` mounts the compressed UFS
image. The installer userland includes many `/rescue` symlinks and additional
Python/ZFS dependencies.

Consequently, an ISO retrofit has two independent roots to replace: the runtime
that boots the installer and the payload it writes to disk. All loaders and
kernel modules must match the new base as well.
[ISO builder](https://github.com/zvaultio/zvio-build/blob/f1e079cdfb9845a562b59f131f4a70aeda215bbe/build/tools/create-iso.py),
[boot image assembly](https://github.com/zvaultio/zvio-build/blob/f1e079cdfb9845a562b59f131f4a70aeda215bbe/build/tools/make_iso_image.sh).

## Implementation stages

### Migration paths for existing TrueNAS CORE users

Support stock TrueNAS CORE as an explicit source platform, not only zVault.
The destination is this independently maintained FreeBSD appliance fork; this
does not constitute an official TrueNAS release or establish that unchanged
TrueNAS middleware works on 15.1.

Plan two entry paths using the same tested target filesystem:

1. **Manual upload where verified compatible.** Provide a legacy-format update
   tarball only for exact source releases whose updater, trust policy, package
   scripts and configuration migration have passed VM tests. Install in a new
   boot environment and preserve the old one. Do not ask users to disable
   verification globally to make the upload work.
2. **Bootable offline migration media.** This is the baseline path for stock CORE
   releases whose updater cannot accept the fork. Boot a package-built 15.1
   environment, discover the old installation, and apply the assembled target
   root to a new BE without executing new userland under the old kernel.

The migration tool must separate inspection, preparation, application and
activation:

- Inspect the source version, boot pool, dataset mountpoints, boot mode, features
  and configuration schema. Report compatibility and the exact destination
  before writing. Identify disks by stable identifiers, not enumeration order.
  Unsupported layouts must stop with an explanation before modification.
- Require a verified configuration export with password secret seed and relevant
  encryption keys, plus a recoverable copy of the original boot media. Keep
  secrets out of project logs and Fossil. Detect legacy GELI pools, native ZFS
  encryption, directory services, jails/plugins and custom tunables; each needs
  a tested migration or an explicit incompatibility result.
- From rescue media, import only the selected boot pool initially, using an
  explicit alternate mount root without incidental data-pool mounting. Inventory
  child datasets before choosing the target BE layout. Preserve old datasets
  and rollback-compatible ZFS features.
- Populate an inactive destination BE with the assembled 15.1 payload. Convert
  a copy of the configuration using a release-specific adapter. Do not mutate
  the old installation's shared database in place. If isolation needs separate
  configuration datasets, implement and test that layout explicitly.
- Validate package/file inventories and boot configuration before activation.
  Failure before activation must retain the old default BE. Track incomplete
  work so an interrupted migration cannot activate a partial root.
- Back up shared ESP/bootcode before any necessary loader changes. Provide BIOS
  and UEFI recovery instructions; BE rollback does not reverse shared bootcode.
- Validate middleware and configuration on first boot before offering data-pool
  imports. Never automatically upgrade pool features. Provide console recovery
  if networking fails. Promise automatic rollback only after implementing and
  testing boot-failure detection.

Maintain a source compatibility matrix. Initially evaluate representative CORE
13.0 and 13.3 releases; add zVault 13.3 if useful. These are candidate
test sources, not a supported list. Add older releases only with fixtures and
successful migration/rollback tests. If an intermediate upgrade is required,
document the exact tested sequence rather than prescribing one generically.

If boot-pool migration is unsuitable, offer installation on a spare boot device
followed by validated configuration import and existing data-pool import. Keep
the old device for recovery. This also requires schema-compatibility testing:
stock FreeBSD alone cannot consume a TrueNAS database and recreate the NAS.

Deliver `MIGRATION.md` with prerequisites, tested source versions, artifact
verification, exact commands, feature limitations and recovery instructions
once these paths work. Until then label artifacts and procedures experimental.

### 1. Acquire and inventory the actual release

1. Select a stock CORE release and obtain its ISO, published checksums and
   matching manual-update tarball. Obtain zVault artifacts only if comparison
   or component reuse would help; they are not required inputs.
   Verify published checksums where available and record local SHA256 hashes
   and original URLs for every input. A locally computed hash is not publisher
   authentication when no upstream checksum/signature exists.
2. List archive members before extraction; reject traversal paths and unexpected
   links. Extract into distinct workspace directories while retaining ownership,
   modes, hardlinks, symlinks, flags and extended metadata needed for repackaging.
3. Inventory outer and inner manifests, package names, scripts, package databases,
   `/boot`, `/etc`, `/conf`, `/data`, `/usr/local`, and the installer runtime.
   Identify which paths are generated or shadowed at boot from `/conf` templates.
4. Record the appliance's actual mount/dataset layout, including whether `/data`,
   package databases and configuration are isolated per boot environment or
   shared. Do not assume that BE rollback also restores every database.
5. Extract the shipped updater, middleware and installer versions. Match source
   revisions to the release. Current middleware `master` includes Linux code and
   is not a reliable reference for the FreeBSD release.
6. Install the original ISO in a disposable VM and prove the original manual
   update path, manifest checks and rollback before changing the payload.

Output: `inventory.md`, input checksums, package/file ownership inventory, and
a baseline VM snapshot.

### 2. Build a clean 15.1 root from packages

1. Create an isolated FreeBSD 15.1 VM/jail or staging root with a private pkg
   configuration, cache and database. All package installation commands must
   target that environment explicitly, never the builder's live root.
2. Fetch authenticated packages for `FreeBSD:15:amd64` from `base_release_1`.
   Record package versions, dependencies, repository metadata and checksums.
   Mirror the selected packages locally so subsequent assembly works offline.
3. Begin with `FreeBSD-set-base` and the repository's GENERIC kernel package
   (`FreeBSD-kernel-generic`, subject to catalog verification). Using the complete
   base initially simplifies diagnosis; trim to smaller sets only after boot
   and appliance tests pass. Include the 15.1 loaders and required modules.
4. Install through pkg, allowing its configuration handling, scripts and database
   registration to complete. Plain archive extraction alone is insufficient.
   Include a compatible pkg binary and the correct repository trust files in
   the resulting system.
5. Install ordinary dependencies from a pinned compatible ports-package snapshot.
   Keep package repositories separated by purpose; do not mix old appliance
   kernel modules or the old OpenZFS stack into the new base.
6. Save the native pkg database and file ownership inventory as part of the
   image. Ensure they survive the appliance's runtime filesystem setup.

Output: a bootable stock 15.1 root populated without compilation, with package
provenance and an offline package cache.

### 3. Restore the appliance layer and resolve compatibility

Overlay only inventoried, compatible appliance assets and deliberate configuration
changes. Do not copy the complete old base or `/usr/local` over the fresh root.
Merge appliance account IDs, rc integration and configuration templates with
the package-provided defaults; preserve the original configuration schema for
the initial experiment where possible.

Start from the CORE functionality and configuration that users need to preserve.
Compare retaining its application layer, selectively using zVault components,
and adapting integrations to available FreeBSD packages. Record the evidence
for each chosen component. If zVault provides no advantage, proceed without it.

Audit at least:

| Area | Required proof or decision |
| --- | --- |
| Python middleware | Interpreter version and every native extension import successfully |
| ZFS | CLI, libraries, Python bindings and kernel interface form a working set |
| BSD integration | `py-bsd`, sysctls, ioctls, interfaces, disk enumeration and jail calls work or are adapted |
| SMB/ACLs | Available Samba packages support the required VFS modules and expected ACL behavior |
| Storage services | SMART, NFS, CTL/iSCSI and disk management use available stock interfaces |
| Boot/configuration | `/conf` regeneration, rc scripts, tunables, loader paths and package state agree |
| UI | Existing built assets and middleware API remain compatible |

Inspect ELF dependencies and package requirements, then run service-level tests.
The old kernel's custom patches and modules are not supplied by changing the
base version string. Backward binary compatibility does not establish matching
Python ABIs, library ABIs, kernel ioctls or appliance behavior.

Any retained old binary must be explicitly listed and tested; it prevents
claiming a wholly rebuilt FreeBSD-package dependency stack. If an essential
extension needs compilation, stop that path and document the unavailable
package and a possible package-backed replacement or reduced feature scope.

### 4. Produce a legacy-compatible transition update

When the source-specific checks support this route, use the old updater to
deliver a **fully materialized 15.1 filesystem**. Assemble and register packages
on the 15.1 builder beforehand.
Do not depend on running a 15.1 pkg executable or other new userland under the
currently running 13.x kernel; a chroot does not change the kernel.

1. From the completed root, regenerate the appliance filesystem package(s),
   matching the actual release's package partitioning and accepted compression
   format. The old `base-os` specification includes much more than base FreeBSD,
   so retain the full intended appliance contents in its replacement.
2. Use the legacy package creator's format or a compatible packaging-only tool.
   Regenerate file lists, file checksums, sizes, versions and all outer manifest
   references. Preserve archive metadata. Make the change require a reboot.
3. Include the target native pkg database after all package transactions finish;
   audit the legacy `freebsd-pkgdb` package, if present, so it cannot restore the
   old database afterward. Reconcile legacy file ownership/removals with the new
   package ownership map. Explicitly remove obsolete old base files from the
   destination clone rather than allowing accidental leftovers.
4. Review all old/new install and upgrade scripts. Legacy removal scripts and
   deferred `/update-scripts` can both affect the migration. Perform only
   operations compatible with the old runtime before reboot; defer necessary
   target-runtime work until the 15.1 kernel is active, before dependent services.
5. Give the fork a distinct version, sequence and update train. Preserve the
   manifest schema needed by the original client. Include only validators that
   remain correct, with regenerated hashes and tested trust policy.
6. Create a flat outer tar with entries such as `./MANIFEST` and
   `./base-os-<version>.tgz`; actual names come from the release inventory.
   This wrapper transports a root assembled by pkg; it is not a pkg repository.
7. First validate the wrapper without installing it. Then apply it through the
   original VM's manual-update flow and inspect the destination BE before reboot.

[Original base-os package specification](https://github.com/zvaultio/zvio-build/blob/f1e079cdfb9845a562b59f131f4a70aeda215bbe/build/profiles/freenas/packages/base-os/config).

If the shipped updater cannot perform the transition safely, use a package-built
15.1 rescue environment to populate an inactive destination BE offline. That
retains the no-compilation design but is not a drop-in web-upload upgrade.
This path does not require a zVault installation, image or updater.

### 5. Validate upgrade, boot and recovery

Use virtual disks only at this stage, including separate disposable data disks.
Keep a copy of the original VM disk and an exported configuration including
secrets needed for restoration. Prevent old BEs from being automatically pruned.

Required acceptance checks:

- Kernel and installed userland report the intended 15.1 release/patch levels
  using `freebsd-version -kru`; package records agree with the locked inputs.
- BIOS and UEFI boot succeed. Inspect shared ESP/bootcode compatibility separately
  from BE contents; if changes are required, capture and test their recovery.
- No old kernel modules load; no unintended old base binaries remain. Dependency
  checks and native Python imports pass.
- Middleware, web login, configuration save/reboot and network persistence work.
- Disposable ZFS pool creation/import, snapshots, scrub and basic SMB/NFS file I/O
  work; test ACLs and any included iSCSI/jail features explicitly.
- Each delivered migration method completes with the builder's network
  disconnected, proving the payload is self-contained. Test the manual-update
  path only for source versions where it is offered.
- Returning to the original BE works, including configuration and service state.
  Shared database changes need their own restoration path.
- No boot-pool or data-pool feature upgrade occurs automatically during testing;
  feature changes could prevent the older environment from importing the pool.
- A second update assembled from packages succeeds. This verifies maintainability,
  not merely a one-time kernel swap.

Passing kernel boot alone is not acceptance of the appliance conversion.

### 6. Reuse the payload in a 15.1 installation ISO

Build any required migration media when that delivery path is selected; it need
not wait for a legacy update wrapper to work. Use a 15.1 runtime assembled from
pkgbase plus required binary dependencies and the common target payload.

For an optional retrofit of a compatible existing appliance ISO, replace its
product packages and manifest with the validated payload. The following runtime
layout details apply to the inspected zVault builder; confirm the chosen image
uses that layout before applying them.

Preserve the existing installer UI and scripts only if their Python dependencies,
dialog implementation, ZFS bindings and disk/boot setup logic work with stock
15.1. Otherwise use a small installer around available FreeBSD tools to apply
the same payload, maintaining the required boot-pool and configuration layout.

Replace the ISO kernel, modules, loader, BIOS boot files and EFI loader together.
Regenerate `base.ufs.uzip` with matching `.mount.conf` and loader settings; review
the diskless `/conf/default` copies so they cannot reintroduce old runtime files.
Use the host's `makefs`/`mkimg`/compression tools to assemble bootable media without
compilation. Size the EFI image for the actual 15.1 loader rather than retaining
the old script's fixed 2 MiB assumption.

Test BIOS and UEFI ISO boot, a fresh installation to an empty virtual disk, USB
hybrid boot if supported, and booting the installed disk with the ISO detached.
Confirm the installed system and installer runtime are both 15.1.

### 7. Define future package-based updates

If used, treat the legacy wrapper as a transition mechanism. Native pkg should
own the FreeBSD base and third-party packages in the new system. Package the appliance
overlay separately and define ownership of configuration templates to prevent
pkg and appliance regeneration from undoing each other's changes.

Retain transactional updates into inactive boot environments, pin compatible
package sets, and adapt the UI's update integration to this policy. Prevent the
old upstream updater from reinstalling a 13.x appliance payload over the fork.
Decide whether subsequent releases keep the legacy wrapper or introduce a new
manifest, offline repository and installer together; do not assume enabling pkg
automatically replaces the appliance's update semantics.

## Deliverables and next action

Planned workspace artifacts:

- `downloads/`: original release inputs and checksums.
- `inventory.md`: package layout, runtime dependencies, boot/dataset topology,
  signature behavior and unresolved package gaps.
- `packages.lock`: exact pkgbase/ports package identities and hashes.
- `scripts/`: repeatable acquisition, root assembly, overlay, packaging and VM
  verification steps; no compilation stages.
- `out/`: experimental migration media and/or manual-update tarball, checksums
  and provenance, according to the selected delivery paths.
- `TEST-RESULTS.md`: boot/service/upgrade/rollback evidence and feature limitations.
- `MIGRATION.md`: tested paths from stock TrueNAS CORE and zVault, a source-version
  compatibility matrix, configuration handling and recovery instructions.

The next implementation action is to select and inventory a stock CORE release,
establish a baseline VM, and identify its native integration requirements.
Build the 15.1 package root independently. Use the inventory to select a delivery
path and decide whether any zVault component is useful. The feasibility gate is
preserving the required NAS behavior with available 15.1-compatible binaries;
progress must not depend on zVault being the solution.
