How to transfer your iTunes Library from Windows Vista to Windows 7. This article also includes information for backing up and restoring your iTunes Library.
Upgrading to Windows 7 with iTunes
I recently upgraded my computer to Windows 7 by installing it on a new hard drive, and as such I needed to transfer all the music, movies and apps from my old hard drive to the new one. I wish Apple's iTunes would automatically detect what stuff you've paid for and re-download it when you log into iTunes, but they don't. Upgrading to Windows 7 with iTunes is actually pretty easy so long as you have all your stuff backed up. In this article, I'll describe what you need to do to transfer your iTunes library from one place to another, be it a new hard drive or a completely different computer.
Please read everything here before you connect your iPod, iPhone or iPad for the first time under the new operating system.
Backup Your iTunes Library
Before you upgrade the operating system on your computer, you should first make sure you have backed up everything you want to keep. Often times the best method of upgrading the operating system means formatting the hard drive first, which deletes everything on there. You definitely don't want to realize that you need something off the hard drive you just erased.
Backup with iTunes
The easiest way to back up your iTunes Library is to let iTunes do it for you. Just open up iTunes and go to File - Library - Back Up to Disc... and choose whichever options work best for you.
Manual iTunes Backup
If for whatever reason you can't get back into the old operating system but still have your data available, the first thing you need to do is locate the iTunes library folder on your 'old' or 'soon to be upgraded' hard drive. In Windows Vista, the default location to find your music, movies and apps is under \Users\username\My Music\iTunes\ where username is your account name on the PC. You should back up this entire iTunes folder because it will hold all of the music from your library as well as all the apps. If you can burn it all to DVD, this is a great way to make a backup copy, but you could always transfer it to a USB flash drive or another hard drive.
(Screenshot taken from iTunes)
Restore Your iTunes Library
Restoring your iTunes Library is simple to do, so long as you have a good backup. All you have to do is open up iTunes, then go to File - Add Folder to Library and then select whatever you want to import from your backup. This will pull in all your music, movies and apps just as they were before and the process is actually quite fast. I had nearly 6 gigabytes of data to move and it only took a couple of minutes.
Now that you have restored your iTunes Library, you can connect your iPod, iPhone or iPad and perform the sync operation.
(Screenshot taken from iTunes)
Syncing iTunes Library
Before you connect your iPod, iPhone or iPad for the first time under your new Windows 7 install, check through your library to make sure everything is there. The reason why is that iTunes makes you associate your device with the new library, and to do this it makes you erase whatever is on your iPod, iPhone or iPad to replace with whatever is in your library. I wish Apple would let you just restore the library from the device, but I guess that would make it too easy for people to share iTunes content without paying for it.
For more information, check out this great article on how to transfer your iTunes library to an external hard drive.