Thunderbolt has minidsplayport functionality in it.
Purchase a Mini Displayport to Mini displayport Cable and plug 1 end into a thunderbolt port of your new iMac and the other end into the Mini Displayport of your old Mac.
Then put your old iMac into target display mode using these methods:
- Here for slightly older iMacs.
- Here and here for younger iMacs.
And it is as simple as that.
If you still want to use your TV as another screen, plug the minidsplay port->HDMI cable into the other thunderbolt connection of your new iMac.
You might want to get a thunderbolt hub, since you will be using both ports on your new iMac this way.