In those days they didn't have copying machines and paper that didn't have a long shelf life. That is why God has told the Hebrews to appoint scribes. Most likely Joshua was the scribe for Moses. God put into Moses' thoughts visions of the past, like the way God gave him visions of the future...