Abdullah bin Amr bin As reported,

A man asked, "Messenger of Allah, which migration is best?"He replied, "That you forsake what your Lord dislikes." عز وجلThe Messenger of Allah ﷺ also said, "Migration is of two kinds, the migration of the city dweller and the migration of the desert dweller. As for the desert dweller, he responds when summoned and obeys when commanded. As for the city dweller, his trial is the greater of the two, and his reward is the greater of the two."

Azami 8129

Sahih

عن عبد الله بن عمرو قال

قال رجل يا رسول الله! أي الهجرة أفضل؟ قال: أن تهجر ما كره ربك عز وجل وقال: رسول الله ﷺ: الهجرة هجرتان، هجرة الحاضر وهجرة البادي. فأما البادي فيجيب إذا دعي، ويطيع إذا أمر، وأما الحاضر فهوأعظمها بلية، وأعظمها أجرا.

الأعظمي 8129صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Jihad
Chapter
Migration
Section
Migration of the settled person is better than migration of the desert dweller
Numbering
Jami al-Kamil 8129 (2nd edition)
Azami 8129