I'm sure in George's mind they stayed on the Tantive IV for the entire 19 years. But as an EU fan I have to take the Droids comics and cartoon into account. Movie purists, cover your eyes.
To begin with, C-3PO is both 100+ years old and made by Anakin. Yes, really.
He was originally constructed 100+ BBY on the planet Affa (from the SW.com databank
). At some point he was damaged, "stripped" and ended up in Watto's junkyard. (Presumably he lost all his previous memories up to this point; hinted at by the Databank which says he "achieved consciousness in a Mos Espa slave hovel").
In a story in the comic anthology Tales
, Anakin found the remnants of 3PO, filled the frame back in with other salvaged components, and reconstructed him. Technically he only re
-built 3PO, not made him from scratch.
All previous reference sources (even post-TPM) say that the Droids comics and cartoons take place after ROTS--variously cited as 15, 10, and 5 BBY. And the Empire is clearly in existence in the cartoon.
Here's my timeline:
112 BBY -- C-3PO is first built
?? -- R2-D2 is built at some point
?? -- 3PO ends up on Tatooine
33ish? - 32 BBY -- Anakin rebuilds C-3PO
32 - 19 BBY -- Events of the prequel trilogy; 3PO has a memory wipe
19 BBY to ANH -- 3PO and R2 leave the Alderaanians' service, go through a series of adventures per the cartoon and comics, and somehow end up back on Alderaan (reference guides establish that they, or at least 3PO, were not on the Tantive IV the entire time they were with the Alderaanians).
Maybe the droids were stolen, lost, or forcibly separated from the Tantive IV, and were purposely trying to find their way back the entire time.