A Commentary, Critical, Practical, and Explanatory on the Old and New Testaments, by Robert Jamieson, A.R. Fausset and David Brown  at sacred-texts.com
deu 31:1MOSES ENCOURAGES THE PEOPLE AND JOSHUA. (Deu 31:1-8)
Moses went and spake--It is probable that this rehearsal of the law extended over several successive days; and it might be the last and most important day on which the return of Moses to the place of assembly is specially noticed. In drawing his discourse towards a conclusion, he adverted to his advanced age; and although neither his physical nor intellectual powers had suffered any decay (Deu 34:7), yet he knew, by a special revelation, that the time had arrived when he was about to be withdrawn from the superintendence and government of Israel.
deu 31:2also the Lord hath said--should be "for the Lord hath said" thou shalt not go over this Jordan. While taking a solemn leave of the people, Moses exhorted them not to be intimidated by the menacing opposition of enemies; to take encouragement from the continued presence of their covenanted God; and to rest assured that the same divine power, which had enabled them to discomfit their first assailants on the east of Jordan, would aid them not less effectually in the adventurous enterprise which they were about to undertake, and by which they would obtain possession of "the land which He had sworn unto their fathers to give them."
deu 31:9HE DELIVERS THE LAW TO THE PRIESTS, TO READ IT EVERY SEVENTH YEAR TO THE PEOPLE. (Deu 31:9-13)
And Moses wrote this law, and delivered it unto the priests--The law thus committed to writing was either the whole book of Deuteronomy, or the important part of it contained between the twenty-seventh and thirtieth chapters. It was usual in cases of public or private contract for two copies of the engagement to be made--one to be deposited in the national archives or some secure place for reference, should occasion require. The other was to remain in the hands of the contracting parties (Jer 32:12-14). The same course was followed on this renewal of the covenant between God and Israel. Two written copies of the law were prepared, the one of which was delivered to the public representatives of Israel; namely, the priests and the elders.
the priests, . . . who bare the ark of the covenant--In all ordinary journeys, it was the common duty of the Levites to carry the ark and its furniture (Num 4:15); but, on solemn or extraordinary occasions, that office was discharged by the priests (Jos 3:3-8; Jos 6:6; Ch1 15:11-12).
all the elders of Israel--They were assistants to the priests and overseers to take care of the preservation, rehearsal, and observance of the law.
deu 31:10At the end of every seven years, . . . thou shalt read this law--At the return of the sabbatic year and during the feast of tabernacles, the law was to be publicly read. This order of Moses was a future and prospective arrangement; for the observance of the sabbatic year did not commence till the conquest and peaceful occupation of Canaan. The ordinance served several important purposes. For, while the people had opportunities of being instructed in the law every Sabbath and daily in their own homes, this public periodical rehearsal at meetings in the courts of the sanctuary, where women and children of twelve years were present (as they usually were at the great festivals), was calculated to produce good and pious impressions of divine truth amid the sacred associations of the time and place. Besides, it formed a public guarantee for the preservation, integrity, and faithful transmission of the Sacred Book to successive ages.
deu 31:14the Lord said unto Moses, . . .call Joshua, and present yourselves in the tabernacle of the congregation--Joshua had been publicly designated to the office of commander by Moses [Num 27:22-23]; and God was pleased to confirm his appointment by the visible symbols of His presence and approval. As none but the priests were privileged to enter the sanctuary, it is probable that this significant manifestation of the cloudy pillar was made while the leaders stood at the door of the tabernacle.
deu 31:16the Lord said unto Moses, . . . this people will rise up--In this remarkable interview, Moses was distinctly apprised of the infidelity of Israel, their corruptions of the true religion through intercourse with the idolatrous inhabitants of Canaan (Amo 5:26), and their chastisements in consequence of those national defections.
deu 31:17Then my anger shall be kindled, . . . and I will hide my face from them--an announcement of the withdrawal of the divine favor and protection of which the Shekinah was the symbol and pledge. It never appeared in the second temple; and its non-appearance was a prelude of "all the evils that came upon them, because their God was not among them."
deu 31:19Now therefore write ye this song--National songs take deep hold of the memories and have a powerful influence in stirring the deepest feelings of a people. In accordance with this principle in human nature, a song was ordered to be composed by Moses, doubtless under divine inspiration, which was to be learnt by the Israelites themselves and to be taught to their children in every age, embodying the substance of the preceding addresses, and of a strain well suited to inspire the popular mind with a strong sense of God's favor to their nation.
deu 31:26Take this book of the law, and put it in the side of the ark--The second copy of the law (see on Deu 31:9) was deposited for greater security and reverence in a little chest beside the ark of the covenant, for there was nothing contained within it but the tables of stone (Kg1 8:9). Others think it was put within the ark, it being certain, from the testimony of Paul (Heb 9:4), that there were once other things inside the ark, and that this was the copy found in the time of Josiah (Kg2 22:8).