Deut. 31:9-13, 16-22, 24-32:47
Upon completion of the law, Moses presented it to the priests and elders of Israel and commanded that it be read every seven years during the Feast of Tabernacles. Since it was not practical with the technology of that day for everyone to have a copy of the law, that was God’s method of presenting it to younger people and of reviewing it with the older people.
God, in His foreknowledge pointed out to Moses that the people would forsake Him for other gods. In preparation for that rebellion, He instructed Moses to write a song warning them of the consequences of that action. That song summarized God’s past care for the Israelites and predicted their future departure from Him. It also described His punishment for their rebellion and His mercy when they would repent and return to Him.
Moses was careful to include Joshua in his last contacts with the people. This allowed his successor to assume the reins of leadership in an orderly manner.