I just built a computer for my parents. Their computer was 7 years old, and the battery is still good in it. Well, it still retains system clock settings and BIOS settings. As a matter of fact, it still functions to this day.
As for replacing your old computer's battery, i would go into the BIOS and manually write the settings down, replace the battery, the reset the BIOS to the specs that you wrote down before replacing the battery. There's probably a better/easier way to do it but that's how i would do it in my own system.