Lisbon to Porto is under three hours by train, and the ticket is cheaper early.
The Alfa Pendular and Intercidades trains link Lisbon Santa Apolónia or Oriente with Porto Campanhã in about 2h50; fares are sold in tiers, so booking a couple of weeks ahead on cp.pt is noticeably cheaper than the same seat on the day. In Lisbon, the Viva Viagem card (or a contactless bank card on the metro and buses) is the way to pay — the famous tram 28 takes it too, and is a queue by mid-morning.

