كتاب العتق
Read the English translation first, with the original Arabic directly underneath.
Narrated `Umar bin Al-Khattab:
The Prophet (ﷺ) said, "The (reward of) deeds depend on intentions, and every person will get the reward according to what he intends. So, whoever migrated for Allah and His Messenger, then his migration will be for Allah and His Messenger, and whoever migrated for worldly benefits or for marrying a woman, then his migration will be for what he migrated for." (See Hadith No. 1, Vol. 1)
الأَعْمَالُ بِالنِّيَّةِ، وَلاِمْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ، فَهِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ، وَمَنْ كَانَتْ هِجْرَتُهُ لِدُنْيَا يُصِيبُهَا، أَوِ امْرَأَةٍ يَتَزَوَّجُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ