When plugged into shore power, I believe the converter tries to charge the battery through the battery cables. When you connect the new battery, you may get a spark from that charge. I could be wrong, but I think I'd shut off anything that's turned on and disconnect from shore power before I hooked up the new battery. Then, I'd reconnect to shore power
after the battery was connected.
I'd rather have to reset my clocks than set off a spark that could ignite the battery fumes.