How to manually restore a iTunes and iPhoto Library? I recently moved to OSX Mavericks from Snow Leopard. I made a copy with Time Machine, perform a clean install and restored some data with the Time Machine backup.

I first tried to recover everything. The SO was a little bit buggy so I wanted to make a better clean installation, so I format again and restored only data and settings. The system is now even more buggy.

So I decided to perform a completely clean install and manually recover all the data I need. To do this I have to manually save all my data. But how can I backup my iPhoto and iTunes libraries? I want to have all the same information I have now, in the new clean system.
Your iPhoto library (by default) is located in ~/Pictures as a package (.photolibrary).
Your iTunes library (by default) is located in ~/Music as a folder.

Copying the entire library will copy all the data (unless you are using referenced media). Your app settings are located in ~/Library/Preferences.