Winamp, need to change your media library location?

Winamp screenshot 5.601

Face it, your library location might change over time. When you’re using Winamp and don’t won’t to loose all valuable data like play count, last play date, … you probably searched around hours to find a solution on how to change the location to your media library (e.g. you swapped hard drives, bought a new pc, …). Rescanning your media folder is the easiest way to rebuild your media library, but you’ll loose play count, play dates and maybe more meta data.

I’ve searched the winamp forum for solutions, but the only result was people asking the same questions without getting the right answers. Depending on your Winamp version you might have tried some none working plugins too. The logical solution would be exporting your winamp media library to an iTunes XML format (and the export process will work!), but you’ll run into fatal errors when trying to import it. It all boils down to getting access to the core data file of your winamp media library (main.dat) and updating an outdated location to a hard drive or directory that has been moved.

I have tested this approach with the latest Winamp version 5.61. Try at your own risk and keep a backup in a safe place in case you run into problems.

For starters you’ve made a backup of your original user’s winamp appdata (c:\Users\<USERNAME>\AppData\Roaming\Winamp\*).

You need a HEX editor (e.g. XVI32) to rewrite the main.dat file, the core data file of your winamp media library which is typically located here: c:\Users\<USERNAME>\AppData\Roaming\Winamp\Plugins\ml\main.dat. This file changes when you open/close winamp.

Be sure Winamp is closed and open main.dat in XVI32. Let’s assume your music is located at F:\My Music and you want to change the location to D:\My Music.

On the left hand you will see the HEX codes, and on the right side you’ll find a more human friendly view. In this view the file location F:\My Music is represented by 46 00 3A 00 5C 00 4D 00 79 and so on. Notice that every character is followed by a NUL character (00). CTRL +R will show a dialog where you can easily convert F:\My Music (46 00 3A 00 5C 00 4D 00 79 …) into D:\My Music (44 00 3A 00 5C 00 4D 00 79 …) in HEX format.  It’s good practice to see if the total amount of replacements resemble the total amount of music files inside your (old) winamp media library. If not, you have done something wrong, or some files got missing. You can rescan your media folder with winamp to remove broken links.

Good luck!

17 thoughts on “Winamp, need to change your media library location?”

  1. Dude, you just saved me! Thank you! My previous portable HDD failed and the network-enabled replacement I found installs it’s publich sharing folder on Drive X without any options.

    The one addition I needed was a map of hex codes so I could figure out what X was, which I found here:

    Thanks again.

  2. Hi, thank you for the tip.

    I think it should work but Winamp resets the main.dat automatically (to an empty file of approx 2ko). This is because the index file (main.idx) doesn’t match the main.dat

    How did you overcome this problem ?

    To restore my library after I tried your method, I HAD to restore main.dat AND main.idx. Main.dat alone wasn’t enough and was always resetted to an empty one.

  3. I was trying to find this in menus and options which seemed pretty trivial for me but didn’t succeed.
    The way you suggested worked perfectly.

  4. To apply a more flexible solution, consider the Visual Subst freeware. Thanks to this tool, you may place your Music folder anywhere, on any drive that is made accessible while Winamp is running (usually an internal HDD, but external drives are possible too). Choose an access letter (let’s call this a logical drive, i.e. a letter to access a partition), and apply the modification described above to change the drive letter in main.idx. Then, create a virtual subst to the real path to your Music folder by associating the access letter you’ve just chosen. Finally, if the path inside the original Music folder was longer than a letter (e.g. M:WinampMusicDB), just ensure you place your current Music folder after the same path (with the updated drive letter). Hope I was clear. As an example, my Music was in E: (which was a music dedicated partition on my HDD) and with this method, I am able to adapt main.idx to my new location for the Music folder, which I chose to be M:WinampMusic and is accessed through a virtual subst. drive with letter W:. That’s it. Good luck!

  5. Last comment was a while ago. I can confirm that this still works with winamp 5.666 (doing upgrade from windows 7 32-bit to Windows 8.1 64-bit with hard drive letter change). Of note, I did move main.idx into the new folder as well (although no hex editing done on that).

  6. Thanks, still works perfect. Replaced EVERY pathname from D: to E: in recent.dat and main.dat. Everything is like it was before. It’s the first time i did/had_to_do this after so many years with winamp. 😉

  7. It’s 2017 now. A lot of things have changed and will change for the worse. But there is 1 constant in my life : WINAMP.

    Thank you so much for this brilliant solution! I used it to edit both recent.dat and main.dat.

    THANK YOU!!!

  8. I tried this on the latest build of 5.8. No luck.

    My new laptop has a small SSD drive C: and a 2TB hard drive which is D: – My old library was on C:….

    I used the Export Media Database function which creates an XML file. Edited it with EmEditor.

    When I used the Import Media Database function back into WinAmp is crashes all the time (35,000 records), so I manually broke the file into 10,000 records pieces.

    Worked perfectly, Ratings, Play Counts, Date Last Played, Comments etc, Album Art

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.