The starting situation for me was that my music files were on an external disk and the library was in my $HOME/Music/iTunes folder.
After trying it a couple times, this is how I did it:
- Shut down iTunes on the old Mac.
- Copied $HOME/Music/iTunes folder my old Mac to the same folder in the new Mac.
- Made a new empty folder called "iTunes Music" inside the above folder in the new Mac.
- Copied all the music from the external disk of the old Mac to the above folder.
That's it. I suspect if my music files had been under my iTunes folder in my home directory instead of an external disk, I could probably have copied it all in one go.