Gradual transition. Some brands provide instructions online on how to do it.
For example, baby drinks 6 bottles of A milk, going to change to B milk.
Day 1: 5 bottles A + 1 bottle B
Day 2: 4 bottles A + 2 bottle B
(You get idea)
B milk is preferred to be consumed in the day, just in case.