Deuteronomy 31:1-25 NKJV
Then Moses went and spoke these words to all Israel. And he said to them: “I am one hundred and twenty years old today. I can no longer go out and come in. Also the LORD has said to me, ‘You shall not cross over this Jordan.’ The LORD your God Himself crosses over before you; He will destroy these nations from before you, and you shall dispossess them. Joshua himself crosses over before you, just as the LORD has said. And the LORD will do to them as He did to Sihon and Og, the kings of the Amorites and their land, when He destroyed them. The LORD will give them over to you, that you may do to them according to every commandment which I have commanded you. Be strong and of good courage, do not fear nor be afraid of them; for the LORD your God, He is the One who goes with you. He will not leave you nor forsake you.”
Then Moses called Joshua and said to him in the sight of all Israel, “Be strong and of good courage, for you must go with this people to the land which the LORD has sworn to their fathers to give them, and you shall cause them to inherit it. And the LORD, He is the One who goes before you. He will be with you, He will not leave you nor forsake you; do not fear nor be dismayed.”
So Moses wrote this law and delivered it to the priests, the sons of Levi, who bore the ark of the covenant of the LORD, and to all the elders of Israel. And Moses commanded them, saying: “At the end of every seven years, at the appointed time in the year of release, at the Feast of Tabernacles, when all Israel comes to appear before the LORD your God in the place which He chooses, you shall read this law before all Israel in their hearing. Gather the people together, men and women and little ones, and the stranger who is within your gates, that they may hear and that they may learn to fear the LORD your God and carefully observe all the words of this law, and that their children, who have not known it, may hear and learn to fear the LORD your God as long as you live in the land which you cross the Jordan to possess.”
Then the LORD said to Moses, “Behold, the days approach when you must die; call Joshua, and present yourselves in the tabernacle of meeting, that I may inaugurate him.”
So Moses and Joshua went and presented themselves in the tabernacle of meeting. Now the LORD appeared at the tabernacle in a pillar of cloud, and the pillar of cloud stood above the door of the tabernacle.
And the LORD said to Moses: “Behold, you will rest with your fathers; and this people will rise and play the harlot with the gods of the foreigners of the land, where they go to be among them, and they will forsake Me and break My covenant which I have made with them. Then My anger shall be aroused against them in that day, and I will forsake them, and I will hide My face from them, and they shall be devoured. And many evils and troubles shall befall them, so that they will say in that day, ‘Have not these evils come upon us because our God is not among us?’ And I will surely hide My face in that day because of all the evil which they have done, in that they have turned to other gods.
“Now therefore, write down this song for yourselves, and teach it to the children of Israel; put it in their mouths, that this song may be a witness for Me against the children of Israel. When I have brought them to the land flowing with milk and honey, of which I swore to their fathers, and they have eaten and filled themselves and grown fat, then they will turn to other gods and serve them; and they will provoke Me and break My covenant. Then it shall be, when many evils and troubles have come upon them, that this song will testify against them as a witness; for it will not be forgotten in the mouths of their descendants, for I know the inclination of their behavior today, even before I have brought them to the land of which I swore to give them.”
Therefore Moses wrote this song the same day, and taught it to the children of Israel. Then He inaugurated Joshua the son of Nun, and said, “Be strong and of good courage; for you shall bring the children of Israel into the land of which I swore to them, and I will be with you.”
So it was, when Moses had completed writing the words of this law in a book, when they were finished, that Moses commanded the Levites, who bore the ark of the covenant of the LORD, saying
NKJV: New King James Version