First, you must authorise your new computer before connecting your new iPhone. To do this, open iTunes, from the 'Store' menu choose 'Authorise Computer'. Follow the dialogues and enter your Apple ID and password, then click the 'Authorise' button.
Next, connect your iPhone to your computer. On the dialogue which then appears, click 'Transfer Purchases'. Do not click 'Erase and Sync' because this erases the content currently on your iPhone.
The process of transferring content to a new computer is explained clearly here; [broken link removed].
With iTunes, you can authorise up to five computers (because of copyright imposed by the content producers). Due to the way your first iTunes library was lost, you now will have just four authorisations left, so be careful!. Don't forget to de-authorise a computer (again, through iTunes) before disposing of it. Be sure to create separate backups of all data on your new computer and you will not have this problem again.