How do I switch between primary battery and backup battery, if the primary battery drops below operating voltage or get disconnected?
LTC4415 is the IC to be used for such application. An enable pin can be used to set the threshold at which you desire the switch over. Here is the Datasheet.
http://cds.linear.com/docs/en/datasheet/4415fa.pdf