Restoring play count & ratings

I transferred my iTunes music to another computer, however it seems that iTunes has lost the ratings and play count numbers. My iPhone 3G, however, still has this info, from the last time it was synced on the other computer. There is also an XML file in the iTunes folder that has the ratings and play counts, but the file paths are from the old computer, and are no longer valid. Is there a way I can transfer the play count and ratings information, either from my iPhone or the XML file, into my iTunes library? I have heard that this can be done by copying the music from the iPhone, but I'd rather avoid it if at all possible, because I already have the music on the computer.

Any help is greatly appreciated!

Power Mac G4, Mac OS X (10.4.11)

Posted on Dec 10, 2009 12:20 PM

Reply
24 replies

Jun 28, 2017 3:15 AM in response to kuabci

These two Windows scripts are referenced in Recover media from an iPod.

  • ImportDevicePlaylists - Imports regular playlists from an iPod or iOS device into the iTunes library. Can import from a selected playlist, or playlist folder, or all playlists on the device.
  • SyncStats - Copies highest play count, skip count, rating and most recent played & skipped date of selected tracks or playlist between iTunes and an iPod or iOS device.


tt2

Jun 22, 2017 1:40 PM in response to kuabci

If you have the old library file, and can use the techniques in Recover media from an iPod or similar to put the files where the library is expecting to see them then the restored library database can work with the recovered files as if nothing has changed. If the tracks don't line up then you'll have a library full of broken links connected to the old tracks, with ratings, play counts, playlist membership etc, and duplicates that you've imported from the media folder as new entries.


I have a Windows solution for matching up existing content in a library with that on a device in order to extract ratings, play counts, etc, and another for playlists. I've no idea how hard it would be to port it to AppleScript.


tt2

Jun 21, 2017 10:56 PM in response to Gil Ramirez

Okay, so I'm in a similar situation but there are a couple of differences. I think I have it figured out, so let me just describe it and people can let me know if they think it will work.


My hard drive decided to up and destroy itself on me the other night. I have an external backup drive, but I haven't backed up for a couple of years (d'oh). Luckily most of the music I've amassed since then is either on my iPod or my work laptop, so I can recover songs from the iPod and gather most of the tunes that are missing from the backed up library. When my new computer arrives in a few days I'm thinking I can restore my backed up library, with play counts and times and dates up to the point when the backup took place, and then I can import all the music that I had added since that time, gathered from my iPod and other computer's iTunes, though of course the play counts will be blank.


SO... if I recreate all my playlists and all the music from my iPod/other compy is now in the shiny, new (restored) library, and THEN I sync my iPod, shouldn't it recognize the library as the one it was synced to before (albeit on a new computer) and won't the play counts transfer over from the iPod since all the songs do exist in the library, just like a sync under regular conditions? So then all the new, blank songs will correlate with the play counts and dates as they appear on the iPod?


I've gone over this so many times in my head and it really seems like it will work, but who knows?

Jan 23, 2010 4:54 AM in response to Gil Ramirez

I also transferred my music and iTunes library from one computer to a new one.
I searched high and low for information about ratings and play counts and while there was a manual trick for ratings, I couldn't find any means of updating all play counts in one go, so I ended up writing a program to do it - which I am happy to share if you email me (I'd attach the files to the forum but it doesn't appear to be possible to add attachments to a post).

First ratings - manual, but easy. Go to your old iTunes machine, create 5 playlists - called e.g. rating1, rating2, rating3, rating4, rating5. Then sort your music by rating, select all 5* and right click add to playlist and choose rating5. Similarly to the other 4 rating levels. Then go to File->Library->Export Playlist... and export the 5 ratings playlists with suitable names - they end up as text files. Move the 5 text files to the new machine and File->Library->Import Playlist... Once the playlists are loaded, go into each one in turn, select all tracks and right click to set the rating level. All manual but pretty quick and easy to do.

Play counts are not so straightforward. The play counts are stored in an xml file in the same directory as your iTunes library. I have written a java program to read both old and new xml files and then to pull the play counts from the old xml file to the new one. However, iTunes doesn't read the xml file after you've made the changes, you have to force it to by renaming/deleting the iTunes library (binary) file (not the file with songs in, just data); then when you open iTunes it appears empty - but don't worry - go to File->Library->Import Playlist... again and this time import the xml file output by my program. After a few minutes of processing everything is back including the updated play counts. This link is to a post that talks about this process of rebuilding the iTunes library from the xml file: http://www.makeuseof.com/tag/how-to-fix-repair-the-lost-link-to-the-itunes-music -library/

There are two issues that I found with following this process, both to do with synching devices to iTunes. I have an iPhone and after synching the applications did not show up in iTunes. So to fix this I plugged in the phone waited for iTunes to detect it, then right clicked on the iPhone device in the left bar of iTunes and selected Transfer Purchases - this pulled the applications across from the iPhone to iTunes and then I was able to sync the iPhone completely.
Second issue was with my AppleTV, which simply didn't appear in iTunes despite on the AppleTV still showing connected to my Computer. My fix for this was to disconnect and then re-choose the computer on the AppleTV, enter the pass code in iTunes and re-connect it again. When AppleTV re-appears in iTunes, you have to input all the sync settings and let it sync again - which is a pain, but having put in the sync settings it just gets on with it - so it wasn't a problem apart from the time it took to re-sync.

If after that explanation you would like to try my program send me an email and I'll happily send you the zip file containing it. You can contact me: tim AT hedger-gourlay.com

Mar 4, 2010 4:54 PM in response to Gil Ramirez

I recently switched from a PC to a Mac. What I did was move the folder with the iTunes library information to the Mac. Then on the Mac, when opening iTunes, I held down the 'command' key ('shift' key on a PC). This opens up a second library. It asks you which library you'd like to use. You then pick the one you just moved over from your other computer. The play counts and ratings should be there. Then, under preferences, you could choose the path to your music and you should be set. It shouldn't take more than 10 minutes, if that!

Oct 22, 2010 3:23 PM in response to hedgert

Hi Gil,

I read your posting with the title in the Subject line above. Thanks for that. Is your XML copy program still a good fix? I recently had catastrophic failure during upgrade to Leopard OS and had to restore from my Time Machine backup (back to OS 5.8). Everything worked perfectly, but all essentially all my ratings (about 6000) were lost, only retained about 50 ratings.

I am very confused why it would retain a small remnant of my ratings...Play counts would be nice to restore too.
My playlist export text files are outdated and have about half I could restore from. But I would like all of them if possible?

Any advice?

Thanks so much

Scott
California, USA

Jan 30, 2015 6:57 AM in response to hedgert

hi,


I'm also trying to restore playcounts from an old itunes XML library.

By matching the track names can I import playcounts from old library?

Please help...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Restoring play count & ratings

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.