Is it obligatory for those who embrace Islam in kaafir lands to migrate (hijrah)?
Question

What is the ruling on those who become Muslim in kaafir countries? Are they included in the hadeeth, “I have nothing to do with any Muslim who settles among the mushrikeen”? And does he have to migrate (hijrah)?.
Praise be to Allah.If a person becomes a Muslim in a kaafir land and he is not able to practise his religion openly and establish regular worship, or he fears for himself tribulation regarding his religious commitment, and he cannot protect his honour, then he is obliged to migrate, because the Prophet (peace and blessings of Allaah be upon him) said: “I have nothing to do with any Muslim who settles among the mushrikeen. But if he is able to practise his religion openly and establish regular worship, and he is able to migrate, then it is mustahabb for him to migrate, but in this case it is not obligatory. 
Ibn Qudaamah (may Allaah have mercy on him) said in al-Mughni: It is mustahabb for him (to migrate) so that he will be able to wage jihad against them – i.e., the kuffaar – and he will increase the numbers of the Muslims and support them. End quote. 
But if he is able to practise his religion openly, and he is safe from fitnah (tribulation, temptation), and he can call people to Allaah and teach the Muslims about their religion, then he may stay and not migrate, because his staying there serves an interest. When Maalik ibn al-Huwayrith (may Allaah be pleased with him) and his companions came to the Prophet (peace and blessings of Allaah be upon him) and stayed with him, when the Prophet (peace and blessings of Allaah be upon him) noticed that they were missing their families, he told them to go back and to teach their people, and he said: “Go back to your families and teach them.” Narrated by al-Bukhaari, 6008; Muslim, 674.  
Al-Bukhaari (1452) and Muslim (1865) narrated from Abu Sa’eed al-Khudri that a Bedouin asked the Messenger of Allaah (peace and blessings of Allaah be upon him) about migration (hijrah) and he said: “Woe to you! Migration is very important. Do you have any camels?” He said: “Yes.” He said: “Do you pay zakaah on them?” He said: “Yes.” He said: “(Even) if you are in the remotest region, Allaah will not cause any of your deeds to be lost.” 
Al-Nawawi (may Allaah have mercy on him) said:  
“Allaah will not cause any of your deeds to be lost” means: He will never allow the reward for any of your deeds to be lost, no matter where you are.  
The scholars said that what is meant by the migration (hijrah) which this Bedouin asked about is staying close to Madeenah with the Prophet (peace and blessings of Allaah be upon him) and forsaking one’s family and homeland. The Prophet (peace and blessings of Allaah be upon him) feared that he would not be able to bear that, and he would not fulfil his rights towards them, and that he would turn back (from Islam), so he said to him: This migration that you asked about is very important, but do good in your own land, and wherever you are it will benefit you, and Allaah will not allow anything of it to be lost. 
So migration depends on whether one is able to practise Islam openly and worship openly. If a person cannot do that and he fears fitnah (tribulation), then he must migrate; if he is able to practise Islam openly but he is able to migrate, then migration is mustahabb (recommended); if he is able to practise Islam openly and he engages in da’wah and teaches the Muslims, then he may stay. And Allaah knows best. May Allaah help us all to do that which He loves and which pleases Him. 
See also question no. 13363.