In order to obtain the Time Lords' secret of time travel, spies from Andromeda (the "Sleepers") successfully infiltrated the Gallifreyan Matrix, choosing Earth as their base of operations. When they discovered the Andromedans' plan, the Time Lords struck back. The actions they took against Andromeda itself are unknown, but they used a Magnotron to move Earth (and possibly the entire Solar System) by several light years to another part of space, and rechristened it Ravolox. When the Sixth Doctor first set foot on Ravolox, and learned that it was Earth, he claimed that two million years had elapsed; however, historical and archeological evidence make this duration unlikely. This action, which seems to have occurred c. 14,000 AD, resulted in considerable death and destruction, but was blamed on a freak cosmic phenomenon (a fireball).
The Ravolox Stratagem was uncovered five hundred years later, when the Sixth Doctor and Peri visited Ravolox, and was publicly exposed during the Doctor's Trial. Indeed, the Doctor was put on trial because the corrupt High Council of Gallifrey was afraid that he would find out what they had done. On Ravolox, the Doctor met the tribe of the Free, led by Katryca. He thwarted Sabalom Glitz's efforts to steal the secrets taken from the Matrix by the Sleepers. He also destroyed Drathro, the immortal robot who guarded the Sleepers, and ruled an underground civilization of human slaves known as UK Habitat (7A-7C).
Afterwards, the Time Lords probably moved the Solar System back to its original location in space, where it was "rediscovered". The destruction caused by the planetary move was still being explained away as the result of a "fireball", or "solar flares", when Earth was reclaimed by the passengers of the space ark Terra Nova, and human colonists from other planets (4C-4B).