It's strange how there's a Temple of Time in Skyward Sword's Lanayru Desert, but the Master Sword is lain to rest at the Sacred Temple in the Faron Province. That ToT seemed to be deteriorated anyhow, so the Sealed Temple likely replaced it, and it became the very one in Ocarina of Time. I'm baffled, though, by how Hyrule Castle was made with a workforce of just two men, Link and Groose (if Groose remained with them), and Zelda, the lady. A tribe of Goron's that Gorko must've known likely helped them build the castle, or in later years Skyloftians migrated to the newly-founded Hyrule and helped construct the castle.
At any rate, from the time between OoT and TP the Hylians seemed to have relocated the castle farther north of Faron, abandoning the Sacred Grove (in which the Sacred Temple/ OoT Temple of Time existed) and the Master Sword with it, What could have forced such a move, I have no idea, but forest reclaimed that area. Continuing on to WW's time, Hyrule was flooded but the OoT castle remained, except they were forced to hide the Master Sword beneath it, where its power dwindled. And that essentially accounts for the changing places of the MS and its pedestal.