Type: Music
Created: 2015.08.24
Posted: 2017.10.31
Have music on your iPod that isn't on your computer?
Good news, your music can be recovered.
Bad news, it isn't super easy.
OK news, I wrote a PHP script to make it easier.
Years ago a friend asked if I could help her mom recover music stuck on her iPod. Most of it was music she ripped from owned CDs, but her computer crashed and she lost everything. To save time from ripping every CD again, my friend thought her mom's music could be transferred back to her computer from her iPod. I thought so too, and while it was easy to get the files, I ran into a problem, all ID3 tags were stripped from the files, filenames were random letters (HBUC.m4a) and files were in random folders. But the pieces to the puzzle are stored in a SQLite database.
Since all of the information is in a SQLite database, I thought to export each type of information (genre, track name, location, etc.) into a different XML file. I chose XML because XML is easy to deal with in PHP. After studying the data for a while, I found the relations and then started to piece together a PHP script.
SQLite Manager - Firefox Add-on
MP3Tag
PHP Script
Use iBackupBot or iFunbox to copy the entire contents of your iPod's music folder.
Use SQLite Manager to export the following tables with headers to CSV:
The script is written to handle XML, not CSV. There are two options:
After unzippping PHP Script package from above, drop all XML into "xml" folder, and music into "music".
Important: Make sure the original iPod folder structure stays intact (ie. music/iTunes_Control/Music/<Fxy>/<filename.m4a>)
Once everything is in place, run fix-ipod-music-filenames.php
Open all files in MP3Tag and select, Convert -> Filename - Tag. Match variables to filename (you can use the arrow to the right). Feel free to preview, click OK when ready.