God said to Moses, “The time is drawing near for you to die. Call Joshua and present yourselves in the Tent of Meeting.” Moses and Joshua went, and God appeared in a pillar of cloud at the entrance.
God warned Moses that after entering the land, the people would go astray after alien gods, break the covenant, and face many troubles. They would say, “Surely it is because our God is not in our midst,” yet God would still hide His countenance because of their choices.
So God commanded Moses to write a poem and teach it to Israel, so it would stand as a witness. That day Moses wrote it and taught it. God also charged Joshua: “Be strong and resolute, for you shall bring the Israelites into the land I promised, and I will be with you.”
When Moses finished writing the Torah, God’s Teaching, he told the Levites to place the book beside the Ark as a witness. He gathered elders and officials, called heaven and earth to witness, and then recited the poem to the whole congregation.