What's the most robust way to backup an iTunes library?
You simply need to backup the entire iTunes folder and optionally the alternate folder(s) where the media is stored.

To ensure your media is consolidated so you don't have to track more than two folders for backup, be sure to allow iTunes to consolidate and organize your music.


The files stored are readable by both mac and windows so you can place them on the new machine, perhaps re-link the directory structure since a Mac won't know what to do with C:\My Documents\Music\Itunes\whatever but everything including the counts, downloaded apps, artwork and playlists will all transfer. You may need to find the folder where iTunes stores iOS device backups as that may be in a different location but that's easy to recreate by plugging your device into the new iTunes and finishing one backup.

It's still a good idea to export the library as XML to cover you for times when the iTunes database gets corrupt but this will work across all versions of iTunes in the past.