Switching from ITunes to Amarok: Tips and Tricks


Itunes Logo —–> Amarok Logo

First, this post will be updated VERY OFTEN, so, please visit it every once in a while.

The purpose of this post is helping everyone switching from the so great Apple’s ITunes to a free choice, Amarok for Linux. Let’s point out that I’m using Amarok on Ubuntu, under GNOME, not under KDE, with no problem at all, with a great speed and with no apparent bugs (For as much as I’ve able to see), so, feel free to use this wonderful player under any Linux platform.

The Amarok version I’m using is 1.4.5 Fast Forward, under Ubuntu Feisty Fawn! (The Ubuntu version doesn’t mutter much if the Amarok version is the one I’m referring to.)

Capter 1: Sound gain normalized automatically

Amarok Replaygain

In ITunes there’s a very useful option that analyzes all of the sound tracks in your library to normalize them on the same perceived sound level. That’s because, from an Album to another and depending also on the quality and native volume of every audio track you are listening, it may be necessary to readjust the volume on every track you listen to. One is louder than another, so, the automated volume adjustment is absolutely necessary, I cannot live without it.

Well, don’t think that in Amarok you’re alone! You’ve got this option too, but you’ve got to install an extra script before (It should be available boundled into amarok IMHO). To do it, Open:

Tools –> Script Manager

Click on Get More Scripts and look for Amork Replay Gain. Click on it and Install it. Close the Get More Scripts window and, in the Script Manager, click on amarok_replaygain.py and then on the button Run. Very well! From this moment, the Volume of every Sound Track you’ll listen to will be automatically normalized, so that you’ll have the impression that every track is loud as the other ones!

This is the hottest and most useful amarok script I’ve ever seen around. I dunno how would I be able to use Amarok without it, really. Thanks so much to the authors!

UPDATE: To have replaygain do the big work once for all, right click on a random file in your playlist and click over the Apply Replaygain Tags –> To entire Collection using Album Tags. The Replaygain process will be much more smoother and quicker from now on :)

Chapter 2: Exporting ITunes Library and Playlist

So you’re switching to Amarok but are used to your Itunes Library and Playlist… how to solve this problem? Do you have to build again all of your playlists? Not at all. there’s a tool to do this: itunes2m3u. I’m hosting this tool, so, download it clicking here.

We’ll need this file in a second moment. For now, go into the dir where Itunes stores your Library. in OSX, usually, this dir is into:

your shortname --> Music --> ITunes

The shortname is your username, the one you use to log in. Myne, for example, is darkmaster. If you open Finder you’ll immediatly notice your shortname directory.

Into this folder, you’ll find a file called:

ITunes Music Library.xml

You’ll also find a dir called:

ITunes Music

To migrate that folder into a Linux installation, you can just create a new dir into your home called music and copy into that all the music contained intothe ITunes Music dir. For example, let’s assume that yor homedir in Linux is called userhome (That’s only an example). In this case, in Linux, after the copy process, you’ll have this dir:


and into this folder there will be the entire ITunes Music Library of your previous Mac OSX installation. Now create a separate folder in your home, call it playlists. Copy paste into this dir the “ITunes Music Library.xml” file. Untar the downloaded itunes2m3u application into this playlists dir too. Now, open with a text editor the file “ITunes Music Library.xml”

You’ll have to find a line where a random song location is stored. Usually this line appears like something of that kind:


you have to replace this line, each time it appears, in the entire document, with another line. To do this, every Text editor has an automated function. For example, in GEdit (Gnome’s standard Text editor), you’ll have to go to in the menù:

find –> replace

In the find box insert this line:


Where you’ll replace usershortname with the real shortname of the OSX installation. In replace with you’ll insert:


Than you’ll click on the Replace button and after several seconds, the replacing process will be completed.

What have we done here? Simply, we specified to the xml file that our Music library files are not anymore in the old OSX dir but in the new Linux one we previously prepared.

Now, save this modified xml file with a simpler name, something without spaces or caps like:


This file has to be in the same dir where the itunes2m3u.py file is stored. Now open up a terminal. First, let’s enter into the dir where our application and xml file are stored:

cd playlists

And now let’s use the tool to extract from the xml file all of our playlist in a format that Amarok will be able to read (m3u):

itunes2m3u.py musiclibrarymod.xml

Wait for the completion of the process. Now, into the playlists dir, you’ll have a number of .m3u playlists! Open Amarok, click on the Playlists button, right click on the Playlists red folder that appears and select Import Playlist. Choose all of your new .m3u files and enjoy!

Remember that for amarok to continue working you’ll have to leave the .m3u files where they are. The same must be done for your music library. Moving any file will result in amork being unable to play the songs!

Capter 3: Importing Ratings from your old ITunes Library

So we’ve already seen how to locate the ITunes .xml library file. Now let’s see how can we import not only the playlist but the ratings of our songs too into the fantastic Amarok.

Let’s point your web browser to THIS link. You can directly download the script from here: Download the script or from the page of the author. In that page there are also the instructions on how to use it. I don’t know why, but some of those instructions are not exact, so, basically, here are the corrected by me instructions:

  • Download the file above
  • Open Amarok and select Tools –> Script Manager from the menu.

Amarok Script Manager

  • Choose Install script.
  • Select the newly downloaded file (You don’t even have to extract the archive)
  • Run the newly installed script (As you can see from the screenshot, find the script into the Score folder)
  • Select the iTunes Library XML File (this file has to be exported in iTunes)
  • Depending on the size of your library, get a cup of your favorite beverage
  • If your library is big, why not go for lunch?
  • Still here? Maybe you can count with the progress meter? (Good night)

Should it happen that ratings are only applied to some songs, try the following:

  • Make sure, all your music is in the Amarok collection. You can check this by clicking the “Collection” tab. Ratings can only be applied to music in your collection.
  • If the ratings are still not applied, select all music (Ctrl+A) and apply 1 star to all songs. Then set it back to 0 stars. Restart the script.

Is it all OK? It should be, worked for me :) So, have a nice import!


  1. UnderstatementJones

    Howdy – excellent post. So the one thing I really want to do is have Amarok grab all my ratings (and to a lesser extent, play counts) from my itunes library file. It should be possible, even easy. Any ideas?

  2. yes it’s very easy. Since you asked for it, this is going to be the next updated step :) I’m glad you found this How-to useful.

  3. Here you go! post updated :)
    Now you can extract your ratings too with a very convenient and graphical script for Amarok :)

  4. Pingback: The Adventures of Slightly Taller Than Average Man » Links for May 24th

  5. thanks a lot for this how-to 😀 very useful.

    U’r Welcome! 😀

  6. Good stuff !! I just moved my library from iTunes to Amarok !

  7. Awesome! I’m writing an amaroK presentation for our local LUG and this was very useful! One member was asking about itunes to amaroK and I now have a few things to present to him… Thank you!

  8. Hello DarkMaster,
    I am the author of the iTunes rating import script. I recently moved the webpage of the script. Could you please update it? There is a redirect, but you might want to update it anyway. The new address is: http://zanfishen.com/delights/itunesratings.html


  9. Hallo Muro, what to say? I’m amazed you knew aout this little guide and updated the link :)
    Thanks for the advice!

  10. i am running gutsy. i followed the steps and all went well until i got to: itunes2m3u.py musiclibrarymod.xml
    i get the error: “bash: itunes2m3u.py: command not found”
    can you help? where have i gone wrong?
    thanks in advance

  11. Please be sure to be in the right dir. You have to be in the same dir where you stored itunes2m3u.py to execute it, of course.
    If the simple command doesn’t work and you are sure that from terminal you are in the same dir where itunes2m3u.py is, then you can try to use this command instead:

    ./itunes2m3u.py musiclibrarymod.xml

    Don’t know why, but some times the shell doesn’t understand that the command has to be found in the same dir where you are executing it, so with this ./ prefix you make sure that the shell gets the position of the file right. Let me know if you solved your problem 😉

  12. thanks for the quick reply! i managed to fix the problem. i needed to chmod +x the file. once i did, it worked. thanks a million

  13. Hi! And thanks for this useful post. Unfortunately, I’ve lost the iTunes Music Library.xml file in the migration process :-( but I still have de *.xml individual playlists (e.g. Classical.xml, Tango.xml and so on).
    Is it possible to import them into Amarok?

  14. Yes it should be possible, maybe directly in Amarok! Try it and let me know.

  15. I’ve tried to import an xml playlist directly in Amarok, but all the elements I see are called “integer”, “string”, “date”, and so on…

  16. I would like to add something to your “how to” switch from iTunes to Amarok.

    First, I add to change the “properties of the file itunes2m3u.py by typing in the terminal window:
    $ chmod 777 itunes2m3u.py
    (although 777 is a little bit too much)
    and then I add to add “./” to the instruction to run the code, i.e:
    $ :/itunes2m3u.py musiclibrarymod.xml

    I hope this can help other people. Anyway, your instructions were REALLY useful.

  17. hello there. It was very useful your program (itunes2m3u). I would rather say i found very trouble because i had to make essay-error when i changed the files adresses. Instead of:

    what i put was


    because when it changes to the final .m3u , it deletes one of the parentdirectorys, so it worked this way.

    I thought this could work for someone else too 😉

    Regards (and apologize for my english)

  18. I just moved everything from XP over to Ubuntu, and I’ve been looking for a guide like this for a week. Thanks for all the help.

    One thing: the iTunes rating import thing is gone. I found something like it at http://code.google.com/p/itunes2amarok/

  19. Tarah M. Wheeler

    Thank you so much! This worked AWESOMELY!

    Two suggestions: First, for the person who had problems finding the command “itunes2m3u.py”, an easy way to fix that is to use the python command since it’s already apparently in the path in Ubuntu. Use this command: “python itunes2m3u.py yourNewAmarokLibrary.xml”

    Second, I too had a problem with the deletion of one of the parent directories, and the format that worked for me when replacing the strings in the xml file was: “file://../home/tarahmarie/Music/”

    Hope that helps…

  20. Thanks a million. I’ve just made the switch from Windows Vista to Ubuntu and importing the iTunes library was a big worry. Thanks again.

  21. This worked great. I also had problems with the itunes2m3u.py deleteing the parent directory (/home), so I modified the script to add it back in, literally, so it’s a little clunky, but it works.

    I also had issues with muro’s ratings script, which I also pulled off of http://code.google.com/p/itunes2amarok/. It wouldn’t prompt for the .xml. It’s mentioned there that you need kdialog, in kdebase for it to work. After installing kdebase and restarting amarok, it prompted like a champ. It didn’t get all the ratings, but it got the vast majority. I even ran it twice.

    Here’s my modified section of the itunes2m3u.pl. It’s only the /home part with the parenth and plus.
    writeurl(“/home” + path, m3u, encoding)

  22. Guys, to fix the parent directory problem, you have to leave in the localhost part, the script expects it. Instead of in his post you need to do:



    The script simply omits the first entry, which it expects to be localhost and not needed, so if home is the first entry it omits that instead.

  23. Pingback: Embedding iTunes track ratings in track comments « Wilsonconnect’s Weblog

  24. So does anyone know if, when switching to Amarok, one is able to play files originally bought from the itunes store?

  25. The link to the script is broken..
    http://zanfishen.com/delights/itunesratings.html <= doesn’t work

  26. Okay I’m trying to figure this whole Amarok thing out, I tried to follow your steps and each step I followed I could not do, for example, with the sound gain, I looked exactly where you tell me to, and I could not find it, so i skipped that tried going to the next step, I clicked the “here” for the itunes2m3u hosting tool, didn’t work. By that point i just got annoyed because I’ve been trying to figure this junk out for a while now and just can’t! I can’t figure out how to get the songs I have on Amarok onto my ipod, it’s very frustrating….can you help me? Oh yes and I am using,kubuntu or however it’s spelled, if that matters, ha my brother forced me to get linux! So far it’s been a pain in my rear! But I’m willing to learn!

  27. Hey Jayne, I also found the guide lacking with regard to the installation of the replaygain script. You have to download the script manually from here:
    (Scroll right down to find the download link)

    Be sure to check out the dependencies on the above page. You can use Ubuntu’s Synaptic Package Manager to install things like mp3gain and vorbisgain (I use Gnome rather than KDE, so I didn’t install the kbase dependency [kbase3 seems to be outdated anyway)].

    To install the replaygain script in Amarok, click on the “install script” button and browse to the desktop (or to whereever you downloaded it) and select the .tar.bz2 file. After you’ve installed it, you have to click the “run” button to start it.

    When the script is running, right click a file in your playlist pane and select “Apply replay gain tags > Apply album tag to entire collection”. You can right click to toggle between track mode (for playlists made up of disparate tracks) and album mode (for complete albums, or recordings of live performances).

  28. Hi there,

    My girlfriends recently made this change and the things she misses most are iTunes’ ‘random play’ behaviour and the ability to skip backwards and forwards with simple keyboard shortcuts. The random play being randomly play her entire collection but at the press of a keyboard shortcut skip a song but quite importantly be able to skip back to the previously played track rather than another random one. Can anyone shed any light on whether any of this can be configured for her?



  29. Hey, thanks a lot for the tips. I thought that getting my music out of iTunes was going to be an ordeal.

  30. Hi all. Does anyone know if you can get Amarok synced up with an Apple TV please ?

  31. Hi. This is very cool. However, would it be better if we can put the itune lib in an external drive and then let both itune and amarok access it? I can’t foresee the problems when amarok edit something in the itune directory.

    Another thought, so say I don’t want to put my itune lib to an external drive, then can I just let amarok access the music directory in mac partition directly instead of copying the entire lib? (we are talking 40GB here)

    You probably already know, we can access mac partition through media/Macintosh HD. You may need to chmod to grant permission to access those.


  32. Pingback: building a linux home entertainment center and htpc | semioticpixels

  33. Pingback: de-iTunes-a-Amarok | tikismikis.org

Leave a Reply