If he has enough money to do Hajj or undertake an obligatory migration (hijrah), to which should he give precedence?
Hajj is obligatory and should be done straight away, according to the more correct of the two scholarly opinions. What that means is that Hajj becomes obligatory for the one who is enjoined to perform Hajj as soon as he become able to do it, and it is not permissible for him to delay it with no excuse. See question no. 41702.
Migration from a kaafir land may be obligatory or mustahabb, depending on a person’s situation. If he is able to practise his religion openly and is safe from temptation and fitnah, then he does not have to migrate. But if he cannot practise his religion openly or he fears fitnah for himself, then it is obligatory.
If migration has become obligatory, but a person does not have enough money to both migrate and do Hajj, then migration should be given precedence, because Hajj is not obligatory unless one has money surplus to one’s basic needs. Obligatory migration comes under the heading of basic needs, so it takes precedence over Hajj.
Moreover, delaying migration after it becomes necessary affects a Muslim’s religious commitment, but delaying Hajj is permissible if there is an excuse, and there is no harm in that.
This applies if migration becomes necessary at the time of Hajj, otherwise, if migration becomes necessary before Hajj, then he should do it, then when the time for Hajj comes, if he can afford it, it is obligatory, otherwise it is not obligatory.
We ask Allaah to protect you and to make you steadfast in obeying Him.
And Allaah knows best.