I heard the Messenger of Allah ﷺ say, "There is no Muslim who is struck by a calamity and says, 'Indeed, we belong to Allah and indeed, to Him we shall return. O Allah, reward me in my calamity and replace it for me with something better,' except that Allah will replace it for him with something better."She said, when Abu Salama died, I said to myself, "Which of the Muslims is better than Abu Salama? His was the first household to migrate to the Messenger of Allah ﷺ." Then I said the supplication, and Allah replaced him for me with the Messenger of Allah ﷺ.
سمعت رسول الله ﷺ يقول: ما من مسلم تصيبه مصيبة فيقول: إنا لله وإنا إليه راجعون. اللهم أجرني في مصيبتي، وأخلف لي خيرا منها- إلا أخلف الله له خيرا منها قالت: فلما مات أبو سلمة قلت: أي المسلمين خير من أبي سلمة أول بيت هاجر إلى رسول الله ﷺ ثم إني قلتها، فأخلف الله لي رسول الله ﷺ.
Muslim narrated it in Janaiz (918) through several routes from Ismail bin Jafar, who said, Saad bin Saeed told me, from Amr bin Kathir bin Aflah, from Ibn Safina, from Umm Salama, and he related it.Her statement, "He migrated to the Messenger of Allah ﷺ," means in the path of Allah to which the Messenger of Allah ﷺ called. For he first migrated from Makkah to Abyssinia, and after he came from Abyssinia to Makkah, Quraysh harmed him. It had reached him that a group of the Ansar had accepted Islam, so he migrated to Madinah, and that was a year before the great pledge of Aqaba.Ibn Shihab said, When they intensified their pressure on the Messenger of Allah ﷺ and the Muslims, the Messenger of Allah ﷺ commanded them to go out to Madinah. So they went out in successive groups. Among those who left before the Messenger of Allah ﷺ went out to Madinah were Abu Salama bin Abdul-Asad and his wife Umm Salama bint Abu Umaya, and Amir bin Rabia and his wife Umm Abdullah bint Abu Khaythama. It is said that the first woman riding on a mount to arrive in Madinah was Umm Salama, while some people say it was Umm Abdullah. Then came Musab bin Umayr, Uthman bin Mazun, Abu Huzaifa bin Utba bin Rabia, Abdullah bin Jahsh, Uthman bin Sharid, and Ammar bin Yasir. Then Umar went out, and Ayyash bin Abu Rabia and a group with him.Abu Jahl bin Hisham, Harith bin Hisham, and Aas bin Hisham then sought out Ayyash, who was their brother from their mother. They came to Madinah and told him of his mother's grief, and that she had sworn no roof would shade her, and since he was devoted to her, he felt compassion for her and believed them. But when the two of them took him out, they bound him and brought him to Makkah, where he remained until shortly before the conquest.Ibn Ishaq said, The first of the Messenger of Allah's ﷺ companions among the migrants from Quraysh to migrate to Madinah was, from Banu Makhzum, Abu Salama bin Abdul-Asad bin Hilal bin Abdullah bin Umar bin Makhzum, whose name was Abdullah. He migrated to Madinah a year before the pledge of the companions of Aqaba. He had come to the Messenger of Allah ﷺ in Makkah from the land of Abyssinia, and when Quraysh harmed him, and news reached him of the Islam of those among the Ansar who had accepted it, he went out to Madinah as a migrant. Sirat bin Hisham (1/468).It is possible to reconcile the statement of Bara with the statement of Umm Salama regarding who was first to migrate to Madinah, by saying that Abu Salama migrated there fleeing to preserve his faith, while Musab bin Umayr came to Madinah as a teacher for the people of Madinah after Aqaba. So the absolute priority belongs to Abu Salama.