I am quite excited as I have just managed to do what has been preventing me from completely switching to Ubuntu for a long time: import my iTunes library without losing my precious ratings and playcounts - a very time-consuming activity but extremely rewarding.
In this little tutorial I’ll be outlining the 6 steps I followed in order to achieve the above result. I’ll try to be as clear as possible in order for all audiences to repeat the process successfully. Let’s get started… You should achieve this in about 10min maximum.
1. First thing you need to do is to copy the “iTunes Music Library.xml” to your Linux partition and rename it in order to remove the spaces and make the path as simple as possible and as little error prone as possible. This file is used by iTunes to store all your library’s information and is usually located in a place like /My documents/My music/iTunes/. I for example placed mine in /home/nathan/itunes.xml. Make sure you have access to the path of this file as you will need it soon…
2. Rhythmbox uses a similar technique for storing your library’s information. You just need to locate this file on your disk. To do this, launch the terminal and type in locate rhythmdb.xml. This will output a line which should look like /home/nathan/.gnome2/rhythmbox/rhythmdb.xml - Like earlier, make sure you have access to this path as you will need it soon…
3. Make a backup of the above file by using the terminal command cp rhythmdb.xml rhythmdb.xml.bk - check that the file has been copied by doing a small ls.
4. Now you need to download a little script developed by Bowen Dwelle which I found via this blog post. You can find this script there. Unzip it in a place easily accessible. I for example placed it in /home/nathan/downloads.
5. You are just a few steps away from having your iTunes ratings and playcounts in Rhythmbox! Now open a terminal window and go inside the directory where the file you have downloaded and unzipped is located. Now you will need to run this script using the paths that we got earlier on by typing in the following command: perl [path/to/itunes.xml] [path/to/rhythmboxdb.xml] - In my case I typed in perl /home/nathan/itunes.xml /home/nathan/.gnome2/rhythmbox/rhythmdb.xml - if perl isn’t installed a simple sudo apt-get install perl will do the job.
6. The script will now output a couple of lines and tell you when it is finished. It took about 10 seconds on my laptop… Open Rhythmbox and you should now see your library updated with ratings and playcounts! Note that if you have purchased songs from the iTunes Music Store, these will of course not appear in the library.
Note that I did not write this perl script for importing your iTunes Library into Rhythmbox. If you need support I would suggest you to contact the developer of the script directly.
Hope this will help a few!
Tried the above but got lots of lines saying “Illegal octal digit ‘8′ at /home/house2/Desktop/itunes.xml line 131, at end of line” and a final message saying “itunes.xml has too many errors”
Hi John!
Thanks for leaving your feedback! I’m sorry the script couldn’t help you… Seems to me like the itunes.xml is broken.
Have you tried validating the XML file over there? http://www.w3.org/2001/03/webdata/xsv - That could maybe give you some indication if the file is actually usable or not.
Maybe a clean install of iTunes could help too (don’t forget to export your library first so that you can re-import it with the clean install)…
Hope this helps!
Note: the python script fails if the rhythmbox db file doesn’t have ratings for each song already. Once I added a rating of 1 to each song, then re-ran the script, my ratings xfer’d over from iTunes.