There are a lot of stories about replacement batteries, but I can only give you One good advice: buy an original BMW battery with EXACTLY THE SAME specifications as the original mounted battery.
Your cars computer is programmed with the battery parameters for charging current etcetera. After a battery replacement, the BMW dealer will do the registration procedure in the computer, but that makes it unnecessary expensive. Replacement and programming may match the battery costs.
A friendly BMW dealer who knows I am a good DIY mechanic told me that when the original battery is replaced with exactly the same one, it does not need registration/programming. The only thing then is that the computer has the 'old date' in its memory but will handle the battery as the original one.
The BMW battery will cost you about 25% more than the equivalent of the local carshop but it is worth it and it saves you the trouble of a mischarged battery, which may fail after 2 years.
Replacement you can do by yourself.