All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
If a person makes Hijrah for the Sake of Allaah and in order to please Him, then the reward for his Hijrah is confirmed as long as his intention is sincere. Allaah says (what means): {And whoever emigrates for the cause of Allaah will find on the earth many [alternative] locations and abundance. And whoever leaves his home as an emigrant to Allaah and His Messenger and then death overtakes him - his reward has already become incumbent upon Allaah. And Allaah is ever Forgiving and Merciful.}[Quran 4:100] This verse also indicates that Hijrah is a cause for having abundant sustenance. Qataadah said regarding the interpretation of the above verse: “{He will find on the earth many [alternative] locations and abundance} - it means changing from misguidance to guidance and from poverty to wealth.”
It has been confirmed that ‘Umar ibn Al Khattaab said: I heard the Messenger of Allaah saying: "Indeed, actions are judged according to their intentions and every person will get the reward of what he has intended. Whoever migrates for the Sake of Allaah and His Messenger, then his migration is for the Sake of Allaah and His Messenger, and whoever migrates for worldly benefits, or for the purpose of marrying a woman, then his migration is for what he migrated for." [Al-Bukhari and Muslim]
What is important is that one's Hijrah was initially made for the Sake of Allaah, and there is no harm in afterward seeking livelihood and so on. This does not – Allaah Willing - affect the reward of the migration. The Companions, who made Hijrah to Madeenah engaged in trade and other work, and this did not affect their Hijrah.
For more benefit on having different motives for Hijrah, please refer to Fatwa 246496.
Allaah Knows best.