Convert mapped drive to UNC

Discussion about anything that might be of interest to MediaMonkey users.

Moderator: Gurus

johnieutah
Posts: 2
Joined: Sun Oct 26, 2008 12:54 pm

Convert mapped drive to UNC

Post by johnieutah »

Hi all,

I currently have MM accessing my music off the server using a mapped drive. I've been searching high and low for a way to convert the music locations to use UNC, e.g. go from M:\music to \\server\music. Is there an easy way to achieve this? I know in MM2 you could manually edit the DB and do a find and replace, but since this has changed in MM£, it no longer seems to be an option.

Any help much appreciated. Matt.
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Convert mapped drive to UNC

Post by nohitter151 »

I believe you can do it with this script: http://www.mediamonkey.com/forum/viewto ... =2&t=24841 and that there are instructions on how to do it somewhere in the thread.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
johnieutah
Posts: 2
Joined: Sun Oct 26, 2008 12:54 pm

Re: Convert mapped drive to UNC

Post by johnieutah »

nohitter151 wrote:I believe you can do it with this script: http://www.mediamonkey.com/forum/viewto ... =2&t=24841 and that there are instructions on how to do it somewhere in the thread.
Cheers for that - worked a treat!

Here's the way to do it for anyone else interested. Go to the thread linked to above, download and install SQL Viewer. Back-up your MM DB first before running any of these queries as you don't want to trash your DB and having nothing to go back to!

1. Find out the IDMedia of both the current and new locations. To find out the new location IDMedia (together with the current IDMedia locator), add a duplicate test track from the new (UNC) location. and run:

Code: Select all

 select * from Songs where songtitle = "example song title"
2. Now we know the IDMedia, run the path change query:

Code: Select all

update Songs set SongPath = replace(SongPath, "<current location>", "<new location>") WHERE IDMedia = "<current IDMedia>"
e.g.

Code: Select all

update Songs set SongPath = replace(SongPath, "M:\", "\\SERVER\Music\") WHERE IDMedia = "63"
3. Update the IDMedia to the new location for all songs:

Code: Select all

update Songs set IDMedia = "<new IDMedia>" WHERE IDMedia = "<old IDMedia>"
That's it, worked great for me, and obviously useful no matter which locations are changing, whether it's a mapped drive to UNC or vice-versa etc...

Regards, Matt.
moot.point
Posts: 3
Joined: Thu Mar 09, 2006 6:14 am
Location: Germany

Re: Convert mapped drive to UNC

Post by moot.point »

johnieutah wrote: 2. Now we know the IDMedia, run the path change query:

Code: Select all

update Songs set SongPath = replace(SongPath, "<current location>", "<new location>") WHERE IDMedia = "<current IDMedia>"
e.g.

Code: Select all

update Songs set SongPath = replace(SongPath, "M:\", "\\SERVER\Music\") WHERE IDMedia = "63"
3. Update the IDMedia to the new location for all songs:

Code: Select all

update Songs set IDMedia = "<new IDMedia>" WHERE IDMedia = "<old IDMedia>"
That's it, worked great for me, and obviously useful no matter which locations are changing, whether it's a mapped drive to UNC or vice-versa etc...

Regards, Matt.
Hi Matt,

thanks for the detailed instructions! I had only one small issue with the "replace" Query: In the form above it did not alter the paths because MM did not save drive letters in my DB. This may be because the relevant drive was an external USB drive, but either way, MM usually works with the drive IDs not with the letters.

Anyway, it worked fine when I used the above query with <current location> in the form ":\" rather than "M:\" (assuming that M was the drive letter previously assigned).

SQLView is a brilliant tool!

Cheers,
Malte
beg
Posts: 193
Joined: Wed Feb 04, 2009 12:36 pm

Re: Convert mapped drive to UNC

Post by beg »

Hi,

I tried to use this instruction in order to use my music collection and MM database on my external HDD connected to a laptop as a copy of my music and database from home network, but got the same problem like moot.point. I can list all the songs by current IDMedia, but when trying to replace the songpath-part it does nothing. But I also tried the ":/" like moot.point suggest, which did not make a difference in my case.. :(

any ideas why this is not working in my situation?
ZPrime
Posts: 14
Joined: Tue Sep 19, 2006 10:06 pm

Re: Convert mapped drive to UNC

Post by ZPrime »

I really hate to bump this thread, but I had some info that will help others in my situation.

For a UNC path, IDMedia is always 1. Hence, moving stuff around between various UNC paths is as simple as running the update statement above with the "replace()" function in there.

I seem to reorganize my stuff every year or so and I end up moving shares around on my server (a WHS) and I always have to dig this thread up because I forget the syntax for the replace command. :lol:
Nova5
Posts: 193
Joined: Fri Mar 10, 2006 11:33 pm

Re: Convert mapped drive to UNC

Post by Nova5 »

Moving things about on a server is a great benefit of a UNC share name. The client won't care if the server moved it from D:\Music to t:\Datashare\Auditory\Music

It only ever sees \\Server\Music.

never knows it moved, and never gives the monkey heartburn. If you have a mapped drive the only problem is sometimes the mapped drives in windows vanish for no apparent reason. Giving the poor monkey an anyerism.
danhackley
Posts: 317
Joined: Fri Aug 31, 2007 6:43 am
Location: Scotland
Contact:

Re: Convert mapped drive to UNC

Post by danhackley »

This looks like what I need, but I don't understand some of the instructions from John.

John states:

"To find out the new location IDMedia (together with the current IDMedia locator), add a duplicate test track from the new (UNC) location. and run:

Code: Select all
select * from Songs where songtitle = "example song title""

What does "add a duplicate test track from the new (UNC) location" mean?

Would be grateful if someone could explain this in less tehnical language.
Thanks!
Sony Vaio Laptop
Thecus N5200B NAS
Windows 7
MM3 Gold 3.2
Looking for jukebox software that manages a large collection, has good album art integration and plays flac as well as MP3
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Convert mapped drive to UNC

Post by nohitter151 »

danhackley wrote: What does "add a duplicate test track from the new (UNC) location" mean?
It means to scan a single track from the new location.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
danhackley
Posts: 317
Joined: Fri Aug 31, 2007 6:43 am
Location: Scotland
Contact:

Re: Convert mapped drive to UNC

Post by danhackley »

Thanks, I've got it sussed now!
Sony Vaio Laptop
Thecus N5200B NAS
Windows 7
MM3 Gold 3.2
Looking for jukebox software that manages a large collection, has good album art integration and plays flac as well as MP3
davidbspalding
Posts: 222
Joined: Fri Jan 08, 2010 3:53 pm
Location: Durham, NC

Re: Convert mapped drive to UNC

Post by davidbspalding »

Edit the database? :o This seems like a lot of trouble. As per this FAQ on networked drive MM database, I simply changed all entries in mm.ini from e.g. s:\mp3\src\ to \\192.168.1.11\share1\mp3\src\, restarted MM, used Add/Rescan to reinforce the mappings for all tracks (unnecessary from what I could see), then went about my business. I'm using MM 3.2 btw.

I might've missed something as to why you need to edit the database directly. Letting MM manage the tables seems a safer policy (unless you're experienced at SQL queries).
«Tell me and I'll forget; show me and I may remember; involve me and I'll understand.» Chinese proverb
T43 XP-SP3 2GB RAM, dual hard drives, MM 4.0.3 Gold; Ipod Classic 7G v2.0.4, Nano 3G v1.1.3.
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Convert mapped drive to UNC

Post by nohitter151 »

davidbspalding wrote:
I might've missed something as to why you need to edit the database directly. Letting MM manage the tables seems a safer policy (unless you're experienced at SQL queries).
Editing the database directly is better in the case where you have previously added tracks to a MM library and don't want to lose library-specific data (playcounts, playlists, etc.) which would be lost by rescanning the library, removing dead links, etc.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
bkenobi69
Posts: 410
Joined: Tue May 19, 2009 1:35 pm

Re: Convert mapped drive to UNC

Post by bkenobi69 »

What would be the field names needed to update the artwork path which are linked to the mapped drive?
davidbspalding
Posts: 222
Joined: Fri Jan 08, 2010 3:53 pm
Location: Durham, NC

Re: Convert mapped drive to UNC

Post by davidbspalding »

(sidebar)

Ahhh.... I thought play counts and ratings were stored in MP3 files. Using the File Monitor feature in Options somehow bypasses resetting play counts, I presume.
«Tell me and I'll forget; show me and I may remember; involve me and I'll understand.» Chinese proverb
T43 XP-SP3 2GB RAM, dual hard drives, MM 4.0.3 Gold; Ipod Classic 7G v2.0.4, Nano 3G v1.1.3.
bkenobi69
Posts: 410
Joined: Tue May 19, 2009 1:35 pm

Re: Convert mapped drive to UNC

Post by bkenobi69 »

Just to close my question...

I found that when I updated the mapped path to a UNC path using the SQL-Viewer script + the instructions mentioned, the artwork is automatically updated to the UNC path. Thus, there is no extra step(s) required to get artwork to work.
Post Reply