Messenger of Allah ﷺ said, "I was ordered to migrate to a town which will swallow (conquer) other towns and is called Yathrib and that is Medina, and it turns out (bad) persons as a furnace removes the impurities of iron. (Using translation from Bukhārī 1871)
"أُمِرتُ بِقَرْيَةٍ تأكل الْقُرى - يقولون يَثْربَ - وَهَى المدينةُ تنفى النَّاسَ كَما يَنْفِي الكِيرُ خَبَثَ الحَدِيدِ" .