iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
Quick answer if you let iTunes manage your music: Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive. Start iTunes with the option (shift on Windows) key held down and guide it to the new location of the library.
iPhoto: How to move the Library folder to a new location - http://support.apple.com/kb/HT1229
If you already set up your new iMac, you can use Migration Assistant: http://support.apple.com/kb/HT4889
However, if you already set it up with a user account, Migration Assistant will want to create another. It will explain the procedure.
If your Mac is brand new and you have not yet configured it with an account, you can use Setup Assistant which duplicates your old account on your new Mac.