Friday, May 07, 2010

Downgrade iTunes to Fix Slow Backup/Sync Issues

Update: Thanks to J-Wo, I've added some steps that should make syncing Apps much easier. New steps are in Italics. I've also removed some steps that are no longer applicable.

Like many people on the interwebs, I recently updated iTunes to the newest version (9.1.xx). After doing so, I was faced with a handful of issues that made syncing with my iPhone a miserable experience. Before 9.1, my total backup+sync time each day was about 3-5 minutes. After updating, I was looking at 30-40 minutes for a backup+sync, which is completely ridiculous. On top of that, I was also having issues with iTunes crashing completely when copying certain songs to my iPhone. The only workaround to this was to uncheck those songs to make sure they didn't sync with my phone. Not really an acceptable "solution" in my book.

Fortunately, I have solved both of these problems by downgrading iTunes to the previous version (9.0.3, in my case). The downside is, the process is going to take up a good portion of your day. The upside is, iTunes is back to being functional.

I would suggest reading the full article before following the instructions, just to make sure you really want to go through the trouble. In my experience, it was totally worth the time and effort it took, but not everyone is the same.
DISCLAIMER: I take no responsibility if something goes wrong or this process doesn't work the same way for you as it did for me. I'm simply giving instructions based on my experience. Your results may vary.

Notes:
  • You will retain your play counts, dates, etc.
  • You will LOSE the Date Added dates for all your music. They will be set to today's date. (You'll see why later.)
  • You will LOSE the locations of all of your icons on your phone. You may want to take screenshots of each page, or make some other note as to where your icons are on your phone so you can put them back the way you want. No longer applicable. Thanks J-Wo!
  • You will not lose the data for your apps, even though at one point in the process iTunes will tell you that you will.
  • I make no promises as to whether or not this process will work 100% for you. It worked for me just fine.
  • BACKUP your iPhone or iTouch before starting this. If something goes wrong, you should be able to restore without losing anything.
  • iTunes will see your iPhone/iTouch as a new device when this process is over. There will be some cleanup work to get syncing back to normal again.
  • This process uses some steps from the official Apple KB for re-creating your iTunes database, found here: http://support.apple.com/kb/ht1451.
  • These instructions are for Windows. The MacOS process may be similar, but I don't know.
  • This walkthrough isn't for everyone. I'm assuming you know where some things are located, such as your iTunes Library files, Mobile Applications, etc. I won't be specific with locations of files, since they will be different for everyone.
  • If you use Smart Playlists that reference other playlists, you may need to fix them after this process is over. You may want to remember or note which playlist(s) each Smart Playlist references.
  • I don't sync anything on the Info tab of iTunes (Contacts, Calendar, etc.) with my phone, so I don't know how those will be handled. Ensure that you've backed them up however you need to, just in case.
  • The instructions are based on my memory of an event from a couple of weeks ago. I'll try not to forget anything, but I apologize if I do. If there's something you notice missing while following my steps, please feel free to let me know in the comments and I'll try to add it.
  • I'm repeatedly emphasizing caution, but there really isn't that much of a risk. If you backup your iDevice and your iTunes library files before doing this, you shouldn't have anything to worry about. If something goes wrong, you should be able to re-install the version of iTunes you're currently using, restore your library files and/or restore the backup of your iPhone/iTouch and be in the same crappy position you are now, without losing anything.
If you still want to proceed, continue reading.
  1. Backup and sync your iPhone/iTouch.
  2. Disconnect your device until instructed to connect it again later on.
  3. Backup your iTunes Library.xml and iTunes Library.itl files by copying them to another location on your computer. Your My Documents folder is a great place. You may also want to backup your iTunes Library Extras.itdb and iTunes Library Genius.itdb files. I did not.
  4. Copy your iTunes Library.xml file to your Desktop.
  5. Delete your iTunes Library.xml and iTunes Library.itl from your iTunes Music folder (or wherever they're located for you). I also deleted the iTunes Library Extras and Genius .itdb files. I don't know if this is required or not.
  6. Rename your "iTunes\Mobile Applications" folder to "iTunes\Mobile Applications Backup"
  7. Uninstall all iTunes related software: iTunes, Apple Application Support, Apple Mobile Device Support, Apple Software Update, Bonjour and QuickTime.
  8. Reboot your computer, just to be safe.
  9. Download iTunes 9.0.3 from this website: http://www.oldapps.com/itunes.php. (I don't run that website, nor can I vouch for them 100%. This is where I got iTunes 9.0.3 from. If you have another way to procure an older version of iTunes, feel free to use it.)
  10. Install iTunes 9.0.3 using the file you downloaded.
  11. Run iTunes. This should create blank iTunes Music.xml and iTunes Music.itl files in your iTunes Music folder. Browse to your iTunes Music folder to verify they were placed there.
  12. Optional: If iTunes didn't put the new xml and itl files back in your iTunes Music folder or if you want your iTunes database to be in a different location than the default, close iTunes, hold down the SHIFT key and run iTunes a second time. This will let you let you specify a new location for your database. Be sure to use the Create Library button so that we are starting with a blank iTunes database.
  13. In iTunes, click the File menu and choose Library > Import Playlist.
  14. Browse to and select the iTunes Library.xml file on your desktop. With this file selected, click the Open button. Your old iTunes data will begin importing back into your fresh iTunes database. This process may take some time depending on the size of your iTunes library. Once it's done importing, it will then go through the process of scanning all the music to make sure everything still exists. If you haven't moved the location of your actual music files, it should find everything. There will not be a pop-up status box for this portion of the import, but you'll see the progress at the top of iTunes. I would wait for this entire part of the process to finish before proceeding. I have about 10,000 songs and it took nearly an hour for the entire import/scanning portion to complete.
  15. You will notice that your Applications tab in iTunes is blank. Double click each application (.ipa files) in your "iTunes\Mobile Applications Backup" folder. They will automatically be moved to "iTunes\Mobile Applications" and show up in iTunes.
House Cleaning:

Smart Playlists:
Once iTunes is done scanning everything, you'll notice the little warning icons next to many of your Smart Playlists, if you have them. This is because as it imports the playlists, other playlists that they were referencing may not have been imported yet. You'll need to edit each Smart Playlist and correct the missing information. If you followed my Notes above, you should have made a note of this information and fixing these should only take a few moments each.

Applications:
iTunes didn't add my Applications back to my library for me, but it's not an issue. Move all the files in your Mobile Applications folder to another location. The first time you sync your device (not right now), you'll be able to copy the Apps from your device into your Library.

Ringtones:
If you had Ringtones in iTunes, you may need to add them again. Simply browse your music folder for the Ringtones folder. You can move these files elsewhere (if necessary) and then add them back into your library. 

From here, things in iTunes should look pretty good. The only difference you'll notice (besides the lack of crashing :P) is that all of your music has today as the Date Added date. This can affect functionality of Smart Playlists, but wasn't a huge issue for me. Make sure things are looking good to you before proceeding. Any major problems here might indicate a step was skipped. If something did go wrong, you can delete the new iTunes Library.xml and iTunes Library.itl files and start over from step 10 above.

Syncing:
  1. Before connecting your device, I suggest going into Edit > Preferences, then to the Devices tab and checking the box Prevent iPods and iPhones from syncing automatically. This will allow you to be sure of a few things before the sync process starts.
  2. The first time you connect your device, I believe iTunes will say something about syncing this device for the first time and that your content will be replaced. If it says that, don't worry. Since we told it not to sync automatically, we can get things setup before the syncing begins. At this point iTunes may perform a full backup of your device, which may take a long time (but fortunately not nearly as long as it would in iTunes 9.1). In my case, it didn't replace my earlier backup, so I had two backup options to fall back on. If it doesn't perform a backup, you can force it to by right-clicking on your device in iTunes and choosing Back Up.
  3. Once the backup is finished (if applicable), click on your device and then view each tab to make sure that nothing is enabled for syncing (everything should be unchecked).
  4. After the full backup is complete, iTunes will recognize all the apps installed on your iPhone and will verify that they are installed in iTunes. With your device selected click the Applications tab, it should show all your synced apps as checked and any that are not currently on your iPhone are unchecked.
  5. From here you can begin enabling the different items you wish to sync and specifying the various settings for each (Apps, Music, Podcasts, Pictures, etc.). As you enable the different items you wish to sync, iTunes will warn you that the content on your device will be removed and replaced with the content from iTunes.
  6. Once everything is ready for syncing, feel free to click the Sync button. If you have a lot of content to sync, this may take a while as the content is removed from your device and then added again. 
You're Done!

At this point, everything in your iTunes library and on your iDevice should be pretty much back to the way it was before, but without the pesky hour-long backups.

Again, if something didn't work right or your missing data, you should be able to restore your device or go back to iTunes 9.1 and restore your backed-up iTunes Music.xml and iTunes Music.itl files.

If these instructions helped you at all, or you think something needs clarification or changing feel free to share your thoughts in the comments.

2 comments:

J-Wo said...

This worked like a charm, thanks a bunch! I have a tip though that saved me from having to rearrange my springboard as none of my apps were removed or needed to be reinstalled.

Add the following steps to your "If you still want to proceed, continue reading." section:

5a. Rename your "iTunes\Mobile Applications" folder to "iTunes\Mobile Applications Backup"

14. You will notice that your Applications tab in iTunes is blank. Double click each application (.ipa files) in your "iTunes\Mobile Applications Backup" folder. They will automatically be moved to "iTunes\Mobile Applications" and show up in iTunes

And then in your "Syncing" section insert the following steps:

3a. After the full backup is complete, iTunes will recognize all the apps installed on your iPhone and will verify that they are installed in iTunes. With your device selected click the Applications tab, it should show all your synced apps as checked off and any that are not currently on your iPhone are unchecked

4a. Feel free to sync all your Apps along with Music. You will notice that your iPhone's music will be wiped clean and reinstalled, but your Apps and the Others (usually your Apps data) remain intact.

shafnitz said...

Thanks J-Wo! I'm updating the post with this information now.