Verses 7 and 8 are Moses' exhortation to Joshua.
Moses called Joshua and spoke to him in the sight of all Israel. In his exhortation to Joshua, Moses said, "Be strong and take courage, for you will go with this people into the land which Jehovah swore to their fathers to give to them; and you will cause them to inherit it" (v. 7).
Moses also assured Joshua that it was Jehovah who was going before him and that He would be with him. Furthermore, Jehovah would not fail him nor forsake him (v. 8a). Thus, Moses concluded his exhortation to Joshua with this charge: "Do not fear, neither be dismayed" (v. 8b).
In verses 9-13 and 24-29 we have Moses' exhortation to the priests, the sons of Levi, and to the elders of Israel.
Verse 9 says, "Moses wrote this law and gave it to the priests, the sons of Levi, who bear the ark of the covenant of Jehovah, and to all the elders of Israel." Moses commanded them that at the end of every seven years, at the year of release, at the Feast of Tabernacles, when all Israel would come together before Jehovah their God in the place which He would choose, they were to read this law before all Israel (vv. 10-11). They were to gather the people, the men, the women, the little ones, and the strangers with them, that they might hear, learn, and fear Jehovah their God and do all the words of this law (v. 12). They were to do this so that their children, who had not known these things, might hear and learn to fear Jehovah all the days that they would live upon the land into which they were crossing and which they would possess (v. 13).
When Moses finished writing the words of this law in a book until they were completed, he charged the Levites who bore the ark of the covenant to take this book of the law and place it at the side of the ark, that it might be there as a witness against them (vv. 24-26). Moses gave this charge because he knew the rebelliousness of the children of Israel and their stiff neck (v. 27a). While he was yet alive with them, they had been rebelling against Jehovah. How much more would they rebel after his death (v. 27b)! Moses' speaking here was according to his deep concern for God's people.