Bani Israel Moving To Egypt
The prophet Joseph did not move to Egypt himself, he was taken to there. There was a severe famine that forced them to move to Egypt. God wanted them to be a nation of considerable numbers, it seemed not possible in kan ‘an with its limited resources then.
You can read the entire story in Surah Yusuf, Chapter 12 of the Quran. God’s plan operates within the existing circumstances. At that time, Canaan was suffering from a famine, making it necessary to relocate the tribe. Joseph’s abduction to Egypt paved the way for the divine scheme to relocate his entire family to Egypt. God could have moved them in any case.