I've been working on a user tip for this issue. Please consider this a pre-release draft.
Recovering your iTunes library from your iPod or iOS device
Before you connect any device to an unfamiliar library go to the Edit > Preferences > Devices tab and ensure the box next to Prevent iPods, iPhones, and iPads from syncing automatically is ticked. You can now safely connect the device to your computer without the danger of media being automatically deleted or overwritten.
- Transfer purchases
You can transfer your iTunes Store purchases into a new library, after connecting the device, with the menu item File > Transfer Purchases from <Device>. You should be prompted to authorize the computer to your iTunes account if you have not already done so.
See also: HT1848 - iTunes Store: Transferring purchases from your iOS device or iPod to a computer.
- Back up (iOS only)
If this is an iOS device you should now right-click on it (control-click on a Mac) in the left-hand column of the iTunes window and click Back Up to make a backup of the current settings and application data on the device.
- Recover other media
iTunes only permits the transfer of iTunes Store purchases. If your device contains other media that you've ripped from CD or downloaded from other online stores you can either go back to the original sources or use third party software to extract your data from your device. There is a list of some of the software available below.
- Recover other purchases
Your device may not have held all your iTunes Store purchases. You can recover qualifying purchases from your account by visiting the home page of the iTunes Store and clicking on the Purchased link in the right-hand column.
See also: HT2519 - Downloading past purchases from the App Store, iBookstore, and iTunes Store.
- Restore (iOS only)
Having backed up your device, and rescued all the media from it that you can, you should now restore the device from the backup that you took earlier to ensure that the device is properly associated with this new library. Right-click on it (control-click on a Mac) in the left-hand column of the iTunes window and click Restore.
- Backup your library
For the future you should backup your library to a separate hard drive or network share. The user tip Backup your iTunes for Windows library with SyncToy gives a suggested way of doing this effectively for Windows users. Mac users can make use of Time Machine or Carbon Copy Cloner which does a similar job to SyncToy.
Media transfer software
This list is by no means comprehensive. Compatibility and feature details may have altered since this tip was published.
Product Description Win Mac iPod iOS Playlists Ratings Floola Free cross platform (Linux too) iPod manager. It appears to have partial support for extracting playlists to m3u files rather than transferring directly to iTunes. ? iPod Access Copies music, videos, playlists, ratings and more. Can extract content from hard drive based iPods with damaged databases. iPod2PC Can copy songs, podcasts and playlists to iTunes or a folder of your choice. ? iRip Claims it can copy the contents of your iPod or iPhone to your Mac or PC with a single click. ? TouchCopy Comprehensive tools for copying media and other items from your device to your computer. TuneJack Can copy all songs & playlists from your iPod/iOS device to your PC and optionally add them to iTunes. ? iRepo Can copy selected songs & playlists from your iPod/iOS device to your PC/Mac and optionally add them to iTunes. (TuneJack with options) ? iGadget Can copy selected songs & playlists from your iPod/iOS device to your PC/Mac and optionally add them to iTunes. Can also add other data as notes to non-iOS devices. (TuneJack with more options) ? Music Rescue Copies music, videos, podcasts, audiobooks, audio recordings, playlists and notes. ? SharePod Free tool that can add, remove and copy media to or from your device. YamiPod Yet another iPod manager. Mainly designed as a free cross platform (Linux too) alternative to iTunes for hard drive based iPods it includes features for transfering media from your device to your computer. ? iLounge
Copying Content from your iPod to your Computer - The Definitive Guide. Page two of this guide shows how to extract all your media using Windows Explorer or Finder. It is mainly aimed at older devices that can be accessed via disk mode, however tools such as iExplorer may also allow you to use this method to extract media from an iOS device.
See also: Wikipedia: Comparison of iPod managers.
I'd forgotten about syncing photos to the iPod. If you had selected the option "Include full-resolution photos" then there should be a folder containing these on the iPod's hard drive. Otherwise I believe TouchCopy includes an option to extract the lower-resolution versions that would have been made for display on the iPod.
I have followed these steps. I checked the box so my iPhone wouldn't automatically sync. I transferred my purchases and backed it up. I don't understand why I would need to restore it. What I'm wondering is am I now able to uncheck that box and sync both libraries together? The one on the phone is from my previous computer. The computer crashed so I have only uploaded CDs to my new computer. I want to be able to plug my phone in and all the songs on my phone go to my iTunes library and the songs on my new computer sync to my phone. Is there any way to do this??
The point of doing the backup, followed by a restore is to get iTunes to recognize itself as the home library for device while preserving all the settings and application data. If you just restore it as a new device, or try to switch the device into manually managed mode there is a danger of losing this data.
Also, I did the backup but when I tried to restore it it says my backup was corrupted and it could not restore? Why would it give me this message?
Does the iPhone still have your content on it? I.e. did it tell you the backup set was corrupt before it started the process of wiping the phone to reload it, or afterwards?
Either the backup is going to restore properly and your phone should then be able to sync with your library properly, or you will have to set the phone up as a new device.
My recollection is that I once had to have two goes at restoring my iPhone, but I had the security of earlier backups on multiple machines to go back to if it didn't work.