Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
Allah, Exalted is He, will resurrect people with both their souls and bodies, and He will restore the bodies that existed in this worldly life, as He says:
﴿As We began the first creation, We shall repeat it.﴾
And He, Glorified is He, says:
﴿From it We created you, and into it We shall return you, and from it We shall bring you out once again.﴾ [Ta-Ha: 55]
It is authentically established that Allah will send down rain, and the bodies of people will grow from it as vegetation grows, and that the human being will be reassembled from the tailbone ('ajb al-dhanab), which does not decay.
As for the earth from which people will be resurrected, the verse in Surah Ta-Ha indicates that they will be brought out from the earth in which they lived. Therefore, the majority of scholars held that the resurrection will take place from this worldly earth itself.
As for the statement of Allah:
﴿On the Day when the earth will be replaced by another earth, and the heavens as well.﴾ [Ibrahim: 48]
The scholars have differed regarding the meaning of the changing of the earth:
It has been said that its characteristics will be changed: the mountains will be removed, the earth will be leveled, and it will become a white, flat land with no buildings, trees, or recognizable landmarks.
It has also been said that the earth itself will be replaced, and another earth will come in its place.
The texts allow for both interpretations, and there is no definitive evidence that settles every detail concerning how this change will occur.
It is authentically reported that Aishah, may Allah be pleased with her, asked the Prophet ﷺ about the people when the earth is changed, and he said: “Upon the Sirat.” It is also authentically reported from Thawban, may Allah be pleased with him, that the Prophet ﷺ said concerning this: “They will be in darkness beneath the bridge.”
Accordingly, there is no contradiction between saying that people will be resurrected from this worldly earth and saying that the earth will then be changed, because the resurrection and gathering take place first, and then the earth is changed during one of the stages of the Day of Judgment. The change may concern its very substance or its characteristics.
People will be resurrected with both their souls and bodies, their bodies that existed in this worldly life will be restored, and the origin of their resurrection will be from the earth in which they lived, according to the view of the majority of scholars. Then the earth will change on the Day of Judgment. This change may concern its characteristics or its very substance, according to what is indicated by the texts. It is not correct to assert a specific detail for which there is no explicit evidence.
And Allah knows best.