The trick is to make the controller board swappable and an independent set of products.
E.g.: If you make 30 different kinds of industrial machines, have one controller board as an additional product for a total of 31 SKUs.
When the controller board is too old and no longer supported, make a new SKU that is backwards compatible with the old machines.
E.g.: Some televisions allowed the entire controller board to be swapped out, upgrading the TV's OS and HDMI ports with new capabilities. The panel and the case stayed the same.
Similarly, a CNC router or whatever is "just" some analogue wires that go into a digital board. Make the digital board swappable.
A similar mistake that I see is customers that are used to "archive grade paper" asking me how long digital backup tapes last. That's the wrong question!. The important thing is to be able to copy from old tapes to new tapes with full fidelity, which digital technology enables, but analogue technology does not. You can retain data indefinitely with digital media that lasts just a few years. Instead of trying to scrounge up some old floppy or CD readers, just copy the data to BluRay, then cloud storage, and then... whatever.