Complex sentence: The ship also participated in Operation Albion in the Gulf of Riga, but shortly after the German attack began on 12 October 1917, "Bayern" was mined and had to be withdrawn for repairs.
Split into simpler sentences: The ship also participated in Operation Albion in the Gulf of Riga in October 1917. However, shortly after the German attack began on 12 October, "Bayern" was mined and had to be withdrawn for repairs.