Consolidate music libraries on windows and linux computers without doubles?
March 14, 2010 2:10 PM   Subscribe

How can I consolidate music files from two computers (one windows, one linux) into one folder without duplicates? I'm thinking of using rsync.

I have an Ubuntu Linux computer and my wife just got a new windows 7 laptop. She would like to have all of her music and all of my music in iTunes, without doubles.

I have her old drive in a usb enclosure plugged into my Linux computer. I've discovered that she had her music files (mp3s and iTunes m4a, m4p and m4vs) spread out over many different folders. We also have duplicates of many songs on her computer and between our computers. It's a mess.

I was hoping that I could use rsync to find all of her files in one pass and then all of my files in another pass and dump them all into one folder, using the checksum flag to skip doubles. Can I do this as a one liner with rsync, or do I need to write a shell script?

I'm open to other ideas. I suppose I could try to use Robocopy in windows to do this as well, but I'm more comfortable with linux command-line tools. I just can't seem to find the magic combination of switches for rsync this time.

Bonus question: once the files are all in one folder, is iTunes smart enough to organize them back into subfolders according to their tags?

Thanks for your help.
posted by double block and bleed to Technology (3 answers total)
I just went through this recently, though I was using Windows and did it manually. I used a combination of Mp3tag and Oscar's File Renamer to get the files named and tagged as I wanted them to be and then used my eyeballs for the rest. Maybe not the most efficient method but it worked.

I believe if you check the box in iTunes (Edit > Preferences > Advanced > Keep iTunes Media folder organized), it should put things in the proper folder structure, however I'm pretty sure it makes duplicates of all your files (though I may be wrong about that).
posted by bwilms at 2:28 PM on March 14, 2010

I went through this a couple years ago. It is a pain in the ass. There is not an easy one click/line solution for you. My advice (and feel free to follow up with specific questions):

If all your songs have good metadata (id3/tags/etc) - iTunes' 'Find Duplicates' is probably the easiest way to identify them. If they don't have good metadata - that's your first step. It will surely seem insurmountable if you've got even a reasonable amount of music - but look at it this way: once all the songs you have now are properly tagged - its all incremental from then on. Spend a couple weekends with easytag and fix your tracks up first.

Rsync probably won't work because you want to detect the duplicates on the metadata - not on the actual track (ie, if you have an mp4 and mp3 of the same song - or even two mp3s with different tags/bitrates/etc - rsync won't know that these are actually duplicates).

I suggest copying all her music to your computer, and setting a SMB share up from your computer for everyone to access music from. Then use iTunes on her laptop to identify duplicates and remove/consolidate them on your side (after identifying which version of the track to keep - probably the highest quality one or the one in your preferred file format). Make sure to uncheck the 'Keep iTunes Media folder organized' and 'Copy files to iTunes Media folder when adding to library' while you do this. Else when you import them, iTunes will copy it all back to her PC.

Once everything is organized, iTunes is "smart enough" to organize them back (with those checkboxes from above) - but it will make a copy on her machine. Better to find one of the numerous command line scripts/programs available for linux to do it in my opinion. Once its all organized on your machine, delete her iTunesLibrary.xml file and reimport over SMB.

Bonus - once everything is consolidated on your machine, you can more easily share it all to a upnp media player (I use twonkymedia to play all our music on my xbox) and easily back it up (with rsync this time!).

Good luck.
posted by ish__ at 3:12 PM on March 14, 2010

If you can count on the tracks being exactly the same (same file, no id3 tag changes, etc) you could use MD5 hashes to quickly get rid of dups.

iTunes also has a decent "Find Duplicates" feature that will give you a lot of false positives, but is a good place to start.
posted by chrisamiller at 3:19 PM on March 14, 2010

« Older Is this Picasso worth anything ?   |   Looking for old library featured on the CBC. Newer »
This thread is closed to new comments.