Wikipedia says that Osaka used to be spelt 大坂, and is now spelt 大阪.
It is more complicated than that:
- Initially it was 難波 (Naniwa).
- In 1496, it was 小坂 ("Little Hill", Osaka AND Ozaka). 尾坂 and other spellings also exist. This is thought to focus more on the area around Ishiyama Honganji.
- In 1583, Toyotomi Hideyoshi built 大坂城, and throughout the Edo period it was 大坂. Regardless of the kanji 大, the early pronunciation seemed to be short Osaka or Ozaka. Later Ōsaka and Ōzaka are found. Likely influenced by the area around Ishiyama Honganji, but expanded to represent the entire surrounding city. Hence, a change from 小 to 大.
- In 1871, the government decided to spell it 大阪 and pronounce Ōsaka.
Is there a term for what happened, and does it happen often?
If you are only referring to the spelling 大坂 vs 大阪, then I would say government respelling; there is not much in the way of linguistics involved. As for the difference between Osaka, Ozaka, Ōsaka, and Ōzaka, some of it I have indicated above. As for s/z, I suppose it could be related to rendaku, but I can only speculate.