How to create automatic dual battery changeover/switching circuit for uninterruptible power?
The simplest answer is two Schottky diodes.  Put a diode in series with each source.  The current will come from the source putting out the highest voltage. Here, I've just put generic high-current Schottky diodes in the schematic, but you can use cheaper ones depending on your requirements.







simulate this circuit &ndash; Schematic created using CircuitLab

If you always want to use the line-powered switching power supply in preference to the solar-charged battery, then arrange that power supply to put out a little higher voltage than the battery.  It doesn't need to be much, even just a few 100 mV would do it.

Another possibility is to connect the battery directly, and the power supply thru a Schottky diode.  Arrange the power supply voltage to be the battery float charge voltage after the diode.  You can think of the battery as always providing the power, and the power supply charging the battery when on.