We've also been to Lisbon (a few times) and Porto in a different trip, and loved both. Always planned to do the train from one to the other some time so I hope you go ahead with that and report back!
Found the local trains/trams/buses very good - we also did the very interesting train from Lisbon to Cascais which is a pretty little place.
Tram to Belem is essential for the pasteis de nata at the shop with the long queue for takeaway (but there's loads of seating inside).
You MUST eat and browse the Time Out Market near the river at Cais de Sodre. Lots of restaurants/chefs have an outlet, all in the same big hall. You choose from any of them and take unreserved seating. Wonderful place and very popular. Has a nice gift shop as well within the hall.
I know some on MN consider this sad, but I absolutely love Portuguese supermarkets to buy light portable stuff to bring home to keep the holiday feel going a bit :)
Porto was amazing, and, while small as PP said, it's very HILLY! we once walked 13 km in one day around Porto and I swear all of it was uphill
There are lots of nice little places to eat. Don't forget to at least visit the Livraria de Lello which calls itself 'the most beautiful bookshop in the world' - I think there is an entry fee for the actual shop with the wonderful stairs that inspired JKR, but you get it back if you make a purchase, I think that's right.
I'm envious - had some of the best times of my life in Portugal! We love the Algarve too in summer. Have a wonderful holiday, OP!