Check if the battery-backed SRAM contain settings that are hard to recover, like calibration, or just convenience settings like the last front panel state. If the former, there are two ways (that can also be combined).
- Replace the battery while the instrument is powered on. Be very careful not to short anything. If it's a solder-in battery, make sure your soldering iron tip is not grounded. A trick I've used in the past is to unplug the iron just before touching the solder joint, so it's disconnected from power (and ground) while you're touching the board.
- Power it from a floating source, like soldering a temporary battery with series diode in parallel.
You can also go belt and suspenders by using both external power and a temporary parallel battery. Especially if you're worried about your mains power failing at just the wrong moment. There are some tips in
this thread on replacing the HP 3468A battery..
If it's a simple battery holder, then the same applies, but you don't need to do any soldering. Power it on, optionally connect another battery in parallel, and replace the battery using non-conductive tools (if any).