Fallback electronic circuit
The simplest approach is to get a SPDT relay whose coil matches your primary power source (220 VAC), and whose contacts are rated for your secondary power source (12VDC at whatever amps). Use the normally-closed contact to switch the secondary power to the secondary pump. Whenever the primary power is available, the relay will pull in and prevent the secondary pump from running. When the power fails, the relay will drop out and fire up the seconday pump.