The alternative way of doing it is using a changeover relay with a mains coil. That way, when it has mains power it is energised and the machine is driven from the mains. When the mains fails, it runs off the UPS. That isn't too unusual in campers with big inverters on board.
However,
1) If your machine is sensitive to even minor blips in the mains, it'll still lose settings - hopefully it can cope with fractions of a second.
and
2) If you are running the machine when the mains goes out, it'll overload the UPS.
The "right" way of doing it is a big chunky UPS - that way you can run the machine when the power is out, and not suffer caffeine withdrawal during an outage.