Saturday, September 12, 2009

Sync files to an mp3 player with WinMerge

To sync files between my PC and my mp3 player, I'm finding WinMerge to be a fast, lightweight solution.

This is a bit geeky, because WinMerge is generally a programmer's tool. Typically you open two different versions of a file or folder in WinMerge; it shows the differences in a left/right view, and lets you copy differences from one side to the other.

But that's exactly what you need to selectively sync a music collection from one place to another, like to an mp3 player.

What I do is to open my music collection folder (on my PC) and my mp3 player's music folder in WinMerge. It quickly scans for differences, then shows me
  • which folders and files are on left or right only (e.g. not on the mp3 player).
  • which folders and files are different (e.g. different folder contents or different file size)
  • which files and folders are identical (i.e. in sync)
Then it's easy to select files to copy to the mp3 player.

Because I'm a geek, I store my music collection on a mini Linux file server and access it using Samba over a wireless network. You do not have to do this! But just for interest, in this environment and using the setup below, WinMerge generates the diff view of my collection of around 5,000 tracks in about 3 seconds. Of course it will work just the same but faster with files stored on your PC.

The following instructions assume you have installed and launched WinMerge and have your mass storage class mp3 player connected to your PC. My player is a Sansa Clip.

1. Configure WinMerge to do fast scans of your music collection

Edit -> Options



Select the Compare category
Tick Ignore time differences less than 3 seconds
File Compare Method: Modified Date and Size

Changing the file compare method from Full Contents to Modified Date and Size is key to achieving fast scan times. You don't need a byte by byte comparison to sync your mp3s. Date and filesize comparison is fast and all you need.

2. Open your music collection and your mp3 player in WinMerge

In Select Files or Folders Dialog



Left: select music folder on your PC
Right: select music folder on your mp3 player
Filter: *.mp3
Tick Include Subfolders
Click OK

3. Customize the view

You will want an Explorer tree view: View -> Tree mode

It can be handy to show file size differences:

Tools -> Customize Columns
Add left size and right size

4. Save all this as a WinMerge project

File -> Save Project



On this page you also have option to make one side read only. This is handy if you want to protect your music collection and only copy files in one direction - to your mp3 player.

Next time you want to sync files, just open the project. All your configuration steps are saved.


5. Start syncing

WinMerge is now showing your music collection in an Explorer tree view. Different icons in the tree clearly show you which folders and files are
  • on left only (i.e. not on mp3 player):

  • on right only (i.e. only on mp3 player)
  • identical:

  • or different (e.g. different folder contents, different file size)
To copy from PC to mp3 player, select the files or folders to copy, then

Right click the folder or file/s
Copy -> Left to Right

... or just hit the "Copy right" icon in the toolbar:




To check result of the merge, click refresh.

Sin é.