There are three ways to connect a generator as a backup. The first is with a grid tie type inverter but this isn't always the best way nor the least expensive. One problem is if the AC waveform output quality of the generator isn't that good, which is usually the case, then you can have problems with the inverter qualifying the power as good and passing it on to the load.
The second is to use a generator and a separate battery charger. This way your generator can charge the batteries directly and not cause any switching interruption or power quality problems. You just need to start your generator and it supplements the batteries directly.
The third is to use the generator directly to the load by using a bypass switch which just disconnects the inverter from the load and connects the generator directly. This has only one advantage in that you have a true second source of power should the solar system fail in any way.
IMHO, with much experience, it is best to use a combination of the last two options. Charge the batteries directly with a separate charge and also have the option of going direct to the generator.