Yes. Muhammad moved from Mecca to Medina in 622 C.E. in an event called the Hijra (هجرة) or migration.
In year 622 AD.
Muhammad moved to Medina in 622 AD to escape persecution in Mecca and to establish a community where he could freely practice and spread Islam.
It made it possible for him to move to the city of Medina.
The majority of people in Medina (or AlMadinah) accepted the Islam religion even before the migration of prophet Muhammad (peace be upon him) to Medina in the year 623 AD. This is why the prophet was very much welcomed when he arrived to Medina.
Hegira started in 622 AD and when Muhammad had to move from Mecca to Medina to preach Islam.
He went to Medina.
Muhammad
Muhammad
The Prophet Muhammad was buried in Medina. The tomb of Muhammad is in the Mosque of The Prophet (Al-Masjid al-Nabawi) in Medina. The Ka'ba in Mecca does not contain Muhammad's body.
The people of Medina had withheld Muhammad from Mecca. The Meccan nobles wanted to kill Muhammad because he was a threat to their power, but the Bedouins in Medina were related to Muhammad on his mother's side so they wanted to protect him
In medina
Mecca and Medina are cities in Saudi Arabia. Mecca is the birthplace of Muhammad and the holiest city of Islam. Medina is the second holiest city of Islam - Muhammad fled there from Mecca. The tomb of Muhammad is in Medina.