I had posted this request last month but got nothing. I hoping with a little big more details will jog someone's memory. I don't remember how it started or ends, but this I remember.
I don't remember how they got there or back. John and Rodney arrived in alternate universe during a middle of a takeover by a hostile species Ori or Goa'uld at Stargate Command. They found alternate of themselves, Shepherd is dead and McKay is gravely injured and in process of dying. He begged them to go to a room and take his son with them when they go back to their universe. A little boy who has both their DNA. They ended up raising the boy together. I think this is the boy that John was dreaming of. It's in another story called
Infernal Machine part 13 of
Two-Body Problem, whenever he holds the Ancient device that Rodney made for him to hold off bad dreams. He is so bother about the boy showing up in many of his dreams that he gave the device back to Rodney.
Found by Anonymous
A Kind of Surrogate Family