“Holiday” is episode seventeen of season two of Stargate SG-1.
SG-1 visit a world where there is advanced technology by the stargate (advanced in 90s terms in some cases, which was when the episode was filmed; the tablet device looks incredibly primitive in today’s terms).
They meet a man that Teal’c recognises as Machello, a fugitive from the Goa’uld System Lords who was developing advanced technology to fight them.
The man is very old and seems not entirely there, but but this is a sham. He gets Daniel to touch a machine which transfers their consciousnesses.
When they discover what happened, Teal’c and O’Neill accidentally transfer their own consciousnesses when trying to retrieve the machine.
(When this episode was watched, it should have been aired before “Serpent’s Song”, but PickTV mixed some episodes up; unfortunately, not a novelty.)