Muala bin Ziyad reported,

He traced it back to Muawiya bin Qurra, who traced it back to Maqil bin Yasar, who traced it back to the Prophet ﷺ, who said, "Worship in times of turmoil is like migrating to me."

Muslim 7401

Sahih

و حدثنيه أبو كامل حدثنا حماد بهذا الإسناد نحوه

مسلم 7401صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Tribulations and signs of the Hour
Chapter
Virtue of worship during times of turmoil
Numbering
Darussalam 7401
Muslim 7401