How to convert internal boot SSD from HFS+ to APFS?

Solution 1:

Well, I have the beginning of an answer:

MBP-WWG:~ Admin$ apropos apfs
APFSUserAgent(8)         - APFS new container observer
apfs.util(8)             - APFS file system utility
apfs_hfs_convert(8) !!!! - convert an existing HFS file system to APFS file system
fsck_apfs(8)             - APFS consistency check
mount_apfs(8)            - mount an APFS volume
newfs_apfs(8)            - construct a new APFS volume
MBP-WWG:~ Admin$ man 8 apfs_hfs_convert

But the challenge is when the Terminal is open in recovery mode, how many environment variables do I have to set to make it actually work? I know it comes up with PATH=/usr/bin:/bin:/usr/sbin:/sbin but none of those directories exist in recovery mode (they're all on the main volume). I don't know whether redefining PATH is sufficient. Some commands may need other environment variables to function. (shared libraries, manpath,

Tempted to try it on the old machine that has a spinner instead of an SSD.