It is narrated from Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "If it were not for the virtue of migration, I would have preferred to be one of the Ansar, and if people were to walk in a valley or a mountain pass, I would walk in the valley or mountain pass of the Ansar." (That is, I would prefer to be with them.)
Hadith Referenceمسند الإمام الشافعي / كتاب فضائل قريش وغيرهم وأبواب متفرقة / 1784
Hadith Takhrijاخرجه البخاری، مناقب الأنصار ، باب قول النبي صلی اللہ علیہ وسلم : لو لا الهجرة لكنت امراء من الانصار (3779)۔