أمرت بقرية تأكل القرى يقولون يثرب وهي المدينة
I have been commanded to emigrate to a city that shall devour all other cities. They call it Yathrib, but it is Madinah.
~Around the time of the Hijrah, 622 CE · 1 BH
Madinah was originally called Yathrib. About two years before the Hijrah, while he was still in Makkah, the Prophet ﷺ told the Muslims about a dream. He said, "I saw a dream, that I will emigrate to a land with a lot of date palms. So I thought it might be al-Yamamah or Hajar, but it turned out to be Madinah." (al-Yamamah and Hajar were distant towns.)
The Prophet ﷺ also said, "I have been commanded to emigrate to a city that shall devour all other cities. They call it Yathrib, but it is Madinah." In another hadith he said, "Whoever calls Madinah Yathrib should say istighfar, because it is Tabah." Tabah and Taybah both mean "the Pure." Istighfar means asking Allah for forgiveness.
From then on, the Prophet ﷺ only called the city Madinah, Tabah or Taybah. Whenever the Qur'an mentions the name Yathrib, it is only in the words of the munafiqun, the hypocrites.
Islamically, Muslims are not permitted to call the city Yathrib anymore, since the Prophet ﷺ changed its name himself.
Other events recorded in 1 BH. Their order within the year is not established; use the storyline above for the sequence.
أمرت بقرية تأكل القرى يقولون يثرب وهي المدينة
I have been commanded to emigrate to a city that shall devour all other cities. They call it Yathrib, but it is Madinah.
Whoever calls Madinah Yathrib should say istighfar, because it is al-Tabah, because it is al-Tabah, because it is al-Tabah.
وَإِذْ قَالَت طَّائِفَةٌ مِّنْهُمْ يَا أَهْلَ يَثْرِبَ لَا مُقَامَ لَكُمْ فَارْجِعُوا
“And when a faction of them said, "O people of Yathrib, there is no stability for you [here], so return [home]."”
The name Yathrib appears in the Qur'an only on the tongues of the munafiqun.
وَمِمَّنْ حَوْلَكُم مِّنَ الْأَعْرَابِ مُنَافِقُونَ ۖ وَمِنْ أَهْلِ الْمَدِينَةِ
“And among those around you of the Bedouins are hypocrites, and [also] from the people of Madinah.”
Allah and the Prophet ﷺ always call the city Madinah.