كتاب الإمارة
33  
The Book on Government
(20)
Chapter: Swearing Allegiance and Pledging to adhere to Islam, to engage in Jihad and to do Good, after the conquest of Makkah, and the meaning of the phrase: "There is No Hijrah (migration) after the Conquest."
(20)
باب الْمُبَايَعَةِ بَعْدَ فَتْحِ مَكَّةَ عَلَى الإِسْلاَمِ وَالْجِهَادِ وَالْخَيْرِ وَبَيَانِ مَعْنَى: «لاَ هِجْرَةَ بَعْدَ الْفَتْحِ»
Sahih Muslim 1863 a

It has been reported on the authority of Mujashi' b. Mas'ud as-Sulami who said:

I came to the Prophet (ﷺ) to offer him my pledge of migration. He said: The period of migration has expired (and those who wereto get the reward for this great act of devotion have got it). You may now give your pledge to serve the cause of Islam, to strive in the way of Allah and to follow the path of virtue.
حَدَّثَنَا مُحَمَّدُ بْنُ الصَّبَّاحِ أَبُو جَعْفَرٍ، حَدَّثَنَا إِسْمَاعِيلُ بْنُ زَكَرِيَّاءَ، عَنْ عَاصِمٍ الأَحْوَلِ، عَنْ أَبِي عُثْمَانَ النَّهْدِيِّ، حَدَّثَنِي مُجَاشِعُ بْنُ مَسْعُودٍ السُّلَمِيُّ، قَالَ أَتَيْتُ النَّبِيَّ صلى الله عليه وسلم أُبَايِعُهُ عَلَى الْهِجْرَةِ فَقَالَ ‏ "‏ إِنَّ الْهِجْرَةَ قَدْ مَضَتْ لأَهْلِهَا وَلَكِنْ عَلَى الإِسْلاَمِ وَالْجِهَادِ وَالْخَيْرِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1863a
In-book reference : Book 33, Hadith 122
USC-MSA web (English) reference : Book 20, Hadith 4594
  (deprecated numbering scheme)