Madinah is situated in central Hejaz (Saudi Arabia). Red Sea is towards the west and Makkah is about 200 miles = 403 Kilo Meters to the south.
Madinah was called Yathrib before Hijrah and came to be known as Taybah or Madinah. The Prophet (peace be upon him) had great love for this city. He once said that “There is a cure for every disease in the dust of Madinah” (Al-Targhib).
Going to Madinah at any time with the intention of visiting the Prophet’s Mosque is a sunnah, as is performing salah in it, According to a hadith of the Prophet (may peace and blessing of Allah be on him). a salah performed in the Prophet’s Mosque is better than a thousand salats in any other place excepting the Sacred Mosque (Masjid al-Haram) in Makkah.
There is no ihram nor talbiyah for the visit to the Prophet’s Mosque, and it should be emphasized that there is no connection whatsoever between this visit and the hajj.
It is sunnah to have (Taharah), and visit the Mosque of Quba and offer salat in it, as the Prophet (peace be on him) prayed there and encouraged others to do the same.