In "Brothers," Lore explains that after he was beamed off of the ship in "Datalore" he drifted in space---until a passing Pakled ship picked him up.
Nothing in canon speaks to this, but does anything in non-canon talk about what happened on the Pakled vessel? Given Lore's superiority, he surely took over the ship quite easily. Though I'm not sure if that included violence or something else.