If old heater is gong to be removed then you can use 1/2" PEX plumbing to connect that new heater to the cold and hot water plumbing lines for old heater. Pipe insulation on the hot water line..
Then you will need to run AC power........course that will need an AC circuit breaker and a AC ON/OFF switch. An it would need to be a 120V AC water heater....they use a 2000W element so initial heating of that 20 gallons will be slow but should maintain/recover OK.
Run them and the electrical right out compartment access....insulate that opening/space where old heater was.