[Home](/)
I wanted to migrate my ~10 year old iTunes library to something on Linux. I searched for music players and Rhythmbox (https://wiki.gnome.org/Apps/Rhythmbox) seemed good. I liked that it looks very similar to the old iTunes.
I found https://github.com/phauer/migrate-itunes-to-rhythmbox which was just what I needed to do this migration, but it's 7 years out of date and has a number of open issues.
## My starting state
* Computer running Debian 12.
* Drive containing my iTunes data: `/mnt/nas/media/audio/iTunes/`
* This includes music files like: `/mnt/nas/media/audio/iTunes/iTunes Media/Music/The Beatles/Yellow Submarine.m4a`
* and also the iTunes database in xml format: `/mnt/nas/media/audio/iTunes/config_backup/2023-08-03 backup/iTunes Music Library.xml`.
Your config will probably be in the root iTunes directory. I made periodic copies.
* Rhythmbox installed (it came pre-installed on Debian).
* Directory where I want my music to live: `/home/omustardo/ssd/rhythmbox_music/`
## My steps
1. I am not entirely sure if this is required, but I deleted existing Rhythmbox content in `/home/omustardo/.local/share/rhythmbox/`. It may be possible to merge an iTunes library into an existing Rhythmbox setup, but I didn't do that so this document doesn't cover it. I left `rhythmdb.xml` but deleted the internet radio entries in it. I think they cause a mismatch later on since the iTunes data didn't include them. The error was:
```
$ ./migrate-all.sh
Reading iTunes library in ./iTunes Music Library.xml
Creating Rhythmbox playlist in /home/omustardo/.local/share/rhythmbox/playlists.xml
Finished
Reading iTunes library in ./iTunes Music Library.xml
Adding play counts and ratings to Rhythmbox DB in /home/omustardo/.local/share/rhythmbox/rhythmdb.xml
The rhythmbox location http://ubuntu.hbr1.com:19800/trance.ogg doesn't start with a known prefix.
It's likely that we can't match it later to a itunes path.
No songs have been changed. Probably because the iTunes and Rhythmbox song paths could not be matched together. Please check your source_library_root and target_library_root.
```
2. I had trouble getting pip3 install to work, so I just downloaded all of the code, stuck it in a single directory, and tried to run it repeatedly. I had to fix a lot of errors but eventually it worked. My final set of files is:
```
-rw-r--r-- 1 omustardo omustardo 764 Nov 25 2016 common.py
-rw-r--r-- 1 omustardo omustardo 720 Dec 27 16:34 itunes_library_reader.py
-rw-r--r-- 1 omustardo omustardo 5674 Dec 27 16:44 Library.py
-rwxr-xr-x 1 omustardo omustardo 644 Dec 27 20:47 migrate-all.sh
-rwxrwxr-x 1 omustardo omustardo 5093 Dec 27 16:17 migrate-itunes-to-rhythmbox.py
-rw-r--r-- 1 omustardo omustardo 198 Dec 27 15:25 Playlist.py
-rw-r--r-- 1 omustardo omustardo 5484 Dec 27 16:20 rhythmbox_count_rating_integrator.py
-rw-r--r-- 1 omustardo omustardo 2510 Dec 27 16:20 rhythmbox_playlists_writer.py
-rw-r--r-- 1 omustardo omustardo 588 Nov 25 2016 settings.py
-rw-r--r-- 1 omustardo omustardo 1652 Dec 27 15:25 Song.py
-rw-r--r-- 1 omustardo omustardo 1283 Nov 25 2016 transform.py
-rw-r--r-- 1 omustardo omustardo 294 Dec 27 15:25 XMLLibraryParser.py
```
Notable changes were updating all of the imports (python uses `from