The information was taken from the book of Genesis in the Holy bible written by Moses as recorded historical events and not as a prophecy, dream or vison. On his departure from Egypt, he studied under his Father-In-Law Jethro an Ishamellite desendants of Abraham. The very Ismaelite who took Joseph to Egypt as part of God's Master plan.
Moses the second leader after the death of Joseph was also trained by Jethro as a priest who did offered sacrifice unto the God of Abraham as their great ancestor Abraham did. Coupled with his high level of Egytian Education, he was very fast to grap as many information as possible from Jethrow souce. The book of Job a none Jew but of Ishmaelite/Arab origin was written by Moses during his pre-islamic study with Jethro - and about Melchedezek Arab Priest to whom Abraham paid his tithe to.The pre-islamic religion was handed down to Ishmael by Hagar when he grew up and she was regarded as a priestess and founder of the pre-Islamic religion with Ishmeal after Abraham had abandoned them in the wilderness when Ishmael was a child.
As he grew up being a prophet like his father Abraham and being part of the covenant of circumcision, spread the good news to his descendants who took it upto the time of Jethro and Prophet Balaam. Both Moses and Aaron where both trained by Jethro their In-law for their preparation to their official assgiment before God commissioned them to go to Egypt to bring out the people of Isreal from the house of bondage. It appeared that before Moses excape to Egypt, he had already told his parent about his plan of leaving Egypt for Median; so Aaron his elder brother was able to trace him to Median and was living with them and who happened to come to the area Moses met the angel of the Lord who appeared to him in the form of burning bush for the first time. Both brothers trained by Jethrow became the founder of Judaism. Aaron was commissioned by God as the High Priest and Moses was the Prophet.Therefore Moses studied a great deal of Abraham, Ishmael and Isaac from Jethro which he wrote in Genesis being a historical event and not a vision, dream or prophecy although they could be some erros as not every information he got from those source will be very accurate as humans.
Now according to Moses, it was Isaac that was used for the sacrifice after Ishamel and his mother Hagar has been abandoned in the wilderness. But the Koran say it was Ishamel that was used not Isaac for the fact the Ishamel was the only son of Abrahm and this event took place before the birth of Isaac.Now we have three records as witnesses to this account. One is the holy bible written by Moses, two, is the Holy Koran and the Third is the Islamic Hadith. Both the Koran and the Islamic Hadith are all prophecies written by Prophet Muhammed and not recorded events but are shadows of the past and future events; therefore they cannot fulfill exactly but could be very similar to the original historical record in Genesis which proceeds the Holy Koran.
Now in the Koran it was indicated that when the boy has reached the age of working for his father Abraham, he told the son that he got a vision of using him for the sacrifice and the son obeyed.The book of Genesis confimed this; Isaac being a boy was able to carry the heavy logs of wood and climing to the mountain top for sacrifrice. So he was of age as the Koran confirmed. Abraham informed Isaac of using him for the sacrifice as the Lord commanded and Isaac obeyed as the Koran also confirmed in respect of Ishmael.But the Hadith written by the very Prophet Muhammed did not agree on this point with the Koran but agrees with the record in Genesis instead. According to the report in Genesis, Abraham drove Ishamel and his Mother away as a child or as an infant.
The bible revealed that both Ismeal and Abraham did not see again until after the death of Abraham and when Ishmaell was informed, he also came and teamed up with Isaac and buried their father as brothers of the same father. So he only saw his father's corpse for the last time after several years of depature.The Islamic Hadith of Prophet Muhammed also confirmed that Abraham abandoned Ishmael and his mother when Ishmael was still sucking her breast and drinking from the water which Abraham supplied to Hagar before he abandoned them in the wilderness as a child. She even called him and he refused to retun to her but told her that it was the command from the Lord that he should abandon them in the wilderness which the book of Genesis also confimed.
According to the book of Genesis, Abraham pleaded with the Lord for her and his son to stay but God told him to obey the command of Sarrah by sending her away according to Moses record in Genesis. So both records agee although there are some erros on the part of Genesis as regards the infacy description of Ishmael who at the time of their depature was 17 years of age, yet he still regared as a child but both records are similar although with a slight difference of the exact age bracket. Then the bible reveals that it was after the departure of Ishmael and his mother for so many years , that God asked Abraham to used Isaac for the sacrifice being his only son at that particular time while Ishamael was cast out since from his childhood who grew up in the wilderness and married to an Egyptian lady as the book of Genesis and the Islamic Hadith confimed.
Therefore it was Isaac that was to be used for the sacrifice and not Ishmael; According to the Islamic Hidath and the Book of Genesis, Ishmael did not grow up with his father rather it was Isaac untill the dead of Abraham. Since the information in the Koran is a prophecy and not an actual recoded event unlike that of Genesis, Ishmael becomes a shadow of Isaac in the Holy Koran who was used for the sacrified instead since Ishmael represent Isaac as the prophecy in the Koran implied in conformity with the Islamic hadith also written by Prophet Muhammed. For the full details from the Islamic Koran and Hadith click the link helow