INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Import PC library to Mac  (Read 8104 times)

srwooten

  • Recent member
  • *
  • Posts: 43
Import PC library to Mac
« on: October 11, 2015, 10:36:47 pm »

Is this possible? I do not want to re tag a zillion files and make new playlist.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #1 on: October 11, 2015, 11:12:56 pm »

It should be, but the path names are a problem since on Windows the path separator is backslash ( \ ), while on OS X it's slash ( / ).

I don't think anyone has worked out a full method for doing a transfer like this.  In theory you could import your library and have all of your views and playlists set up.  Then you'd need to somehow fix up all of the paths to all of your files, since they will have backslashes.

I've played with simulating this on my Mac, trying to convert some paths from slash to backslash and the Rename, Move, and Copy tool doesn't like it.

The other way (again, in theory) would be to export your old library as an MPL file.  Then use a text editor in find and replace mode to replace backslash with slash.  Then import your library backup to get your views and playlists.  Finally, import the MPL which should have the correct paths to your files.

It's really something you'd need to play with.  Like I said, I don't think anyone has a solid tested method for this.  Yet.

Brian.
Logged

srwooten

  • Recent member
  • *
  • Posts: 43
Re: Import PC library to Mac
« Reply #2 on: October 12, 2015, 11:33:43 pm »

Thanks for the thoughtful reply. I will bear down and re tag.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #3 on: October 13, 2015, 08:56:31 am »

If you're willing to experiment with it some, you might not need to do any real manual work.

I don't have a windows library to work with, but I did some experiments yesterday:

I started with a small library in one location on disk.  Then made a library backup.  Then closed that library.
I wanted the media to be "in the wrong place", so I then moved the media to a parallel directory structure away from the original directory.
Next I created a brand new library.  Then Restored the original library backup into it.  As expected, it showed a bunch of red minus signs (-) next to the files.  I checked to make sure my playlists were there and my custom data (custom fields).  They were.
Here comes the key parts:
1.  Turned on "fix broken links: Yes".
2.  Set up auto import to look in the new base directory where all of the media was located.

I pressed OK on auto import and within seconds all of the old media with red minuses transformed into normal thumbnails!  All of the playlists were intact.  The custom field I created was still there.  It seems to have intelligently repopulated the library, even though I didn't tell it to do any kind of replacement.

It's definitely worth a try.

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #4 on: October 13, 2015, 12:46:13 pm »

A few more thoughts:  I'm not sure why you'd need to re-tag your library.  For most file formats, *most* of the tags from MC's library get written into the files themselves.  Certainly all of the basics like Album, Artist, Name, etc get put into the files for almost every type of file.  WAV is a possible exception.

If you're not writing tags to your media files, you can set MC to do so if you want.

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #5 on: October 21, 2015, 11:06:43 am »

I've just done a full end to end test of this and was successful!

I installed MC20 on a Windows virtual machine and imported about 30 files into it, across several albums and folders.  I added a custom field to the library, just to see if custom fields were transferred properly.  I gave that field values for several of the the songs.  Then I did some song rating in MC20.  Again, trying to make sure that all song properties transfer using my method.

I then built a few small playlists and populated them with a few songs each.

Here's the process I used to transfer the PC MC20 library to my Mac running MC21:

1.  On PC:   Back up library:  File > Library > Backup Library .
2.  Transfer library backup ZIP file from PC to Mac.
3.  Make sure all songs that were imported on PC are on a drive that Mac can see.  I used the exact same drive and folders.  It just appears as a different path on PC versus Mac, and of course the PC uses backslashes ( \ ) while the Mac uses slashes ( / ).
4.  On Mac:  Build a new library:  File > Library > Library Manager > Add Library.
5.  Restore PC library into new Mac library:  File > Library > Restore Library > (choose backup file that you transfered in step 2).  When this is complete you'll see all of your songs, playlists, views, etc.  But the songs will all be "missing" and will have red minus signs ( - ) next to them.
6.  Set up auto import to find the original files:
    A.  Tools > Options > Library & Folders > configure auto import > Folders
          1.  Remove old folder.
          2.  Add folder that contains the media files (songs) in this library.
    B.  Tools > Options > Library & Folders > configure auto import > Tasks > Fix Broken Links > YES
Note:  Do NOT use "Yes (protect files on missing drives)".  That will not work.  It must be set to YES.

After you press OK on the various dialog boxes, the library will magically fix itself, replacing all of the old "missing" entries with the songs that are on the drive you configured for auto import.  All playlists will update.  All songs will still have all of their original properties including ratings, custom fields, etc.

I've only tested this with a small library, but I expect it to work on larger data sets as well.  The only thing I wonder about is multiple auto import folders.  I'm pretty sure you could just do step 6 for every pair of OLD auto import folders and NEW ones, but I have not tested this.

I hope this is of use to someone trying to migrate a library from MC on PC to MC on Mac.

Brian.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Import PC library to Mac
« Reply #6 on: October 21, 2015, 11:34:22 am »

There is a less risky alternative to 6) that's a little more labor intensive.  Fix broken links removes files from the database and auto-import immediately re-imports them which isn't an issue if you have your tags in the files and/or MC "recognizes" them, but in my experience that's not guaranteed. I've had to re-do lookups/tagging for many video files (for example) using that method when doing cross-platform migrations in the past.

A safer, but more challenging, approach is to try and preserve the integrity of the existing database by using the "update database location" mode in the "rename, copy, and move" library tool, and then replacing the file path. This works best if your files have a filepath that can be (mostly) programmatically generated (which you can do on the windows side before you try and move it over).

Caveat: I have used this method to migrate libraries back and forth between Linux and Windows PCs and it works in that context.  I haven't tried it on a mac, but I don't have any reason to believe it would work any differently than on Linux in this specific context.  
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #7 on: October 21, 2015, 11:43:48 am »

A safer, but more challenging, approach is to try and preserve the integrity of the existing database by using the "update database location" mode in the "rename, copy, and move" library tool, and then finding and replacing the changed portions of the file path.

The problem with this approach is that the Rename, Move, and Copy tool is "too smart for us" in this particular task.  Don't get me wrong:  I LOVE RM&C.  It's a great tool!  But in this case it's internal logic gets in the way.  Specifically, if you try to convert paths that have backslashes in them, RM&C will refuse to do it until you turn on the Directories check box.  Once you do that, RM&C will "eat" all of the remaining backslashes in the path!  So the remaining directories and file names all get run together with no path separators at all.  I've tried a few variations of this and got nowhere.  Which is why I turned to the "fix broken links" solution.

You point out some other things though that I have not tested.  :(  Darn.  Perhaps this method is of limited usefulness.

Brian.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Import PC library to Mac
« Reply #8 on: October 21, 2015, 11:51:23 am »

The problem with this approach is that the Rename, Move, and Copy tool is "too smart for us" in this particular task.  Don't get me wrong:  I LOVE RM&C.  It's a great tool!  But in this case it's internal logic gets in the way.  Specifically, if you try to convert paths that have backslashes in them, RM&C will refuse to do it until you turn on the Directories check box.  Once you do that, RM&C will "eat" all of the remaining backslashes in the path!  So the remaining directories and file names all get run together with no path separators at all.  I've tried a few variations of this and got nowhere.  Which is why I turned to the "fix broken links" solution.

You point out some other things though that I have not tested.  :(  Darn.  Perhaps this method is of limited usefulness.

Brian.

I remember grappling with that now, and I figured out a fix.  I posted too quickly, you can't actually use find and replace (I didn't in my case, I just forgot the exact mechanism I did use until I saw your post above about the backslashes).  

What you want is to generate a directory structure programmatically and then recreate it on the far end.  So on Windows you go into "Rename, Move, Copy" and rename all files into your desired directory structure.  You'll want to pick one that more or less approximates your existing directory structure, but will be rigorously consistent.  A notional example:

Code: [Select]
c:\Audio\[Album Artist]\[Album]\[Track] - [Name]
You could replace this with whatever directory structure you want, it's irrelevant as long as it can be described programmatically.  So you run rename, copy, move on the windows side in rename mode in order to "conform" your windows library to that structure (if you already have a consistent structure, it's just insurance).  Then you import the library on the UNIX/POSIX side, and use the "update the database" mode of Rename Move and Copy for every entry to overwrite the whole path with

Code: [Select]
/mnt/Audio/[Album Artist]/[Album]/[Track] - [Name]
Or whatever the default mountpoint is on OSX.  I have different "rules" for different media types, but you only have to move the formulas across that way, no bothering about messing with special characters etc.  Like I said, more labor intensive, but safer for the metadata.

Your method is still perfect if you have all your tags in the files, and I've done it that way too when I knew for sure that was the case.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #9 on: October 21, 2015, 12:37:43 pm »

What you want is to generate a directory structure programmatically and then recreate it on the far end.  So on Windows you go into "Rename, Move, Copy" and rename all files into your desired directory structure.  You'll want to pick one that more or less approximates your existing directory structure, but will be rigorously consistent.  A notional example:

Code: [Select]
c:\Audio\[Album Artist]\[Album]\[Track] - [Name]

Ah, interesting workaround.  I see the wisdom of it.  ...but like you said, potentially a lot of extra work, depending on the layout of your library.  Another case where being organized to start with helps things.  :)

[quote[Your method is still perfect if you have all your tags in the files, and I've done it that way too when I knew for sure that was the case.
[/quote]

You've got more experience with this than I do.  But I don't get why you say the tags have to be correct.  I say this because I was able to transfer over custom fields that are not stored in the files at all.  Maybe you've had the links fail to get reestablished with files that MC couldn't "figure out" because they didn't have enough tags for MC to ID them or something?

Brian.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Import PC library to Mac
« Reply #10 on: October 21, 2015, 12:49:55 pm »

Maybe you've had the links fail to get reestablished with files that MC couldn't "figure out" because they didn't have enough tags for MC to ID them or something?

This more or less.  For 95% of my files everything came through (including custom fields).  But, for whatever reason, MC did not "remember" about 5% of the files (mostly video files, but a few others), and I lost metadata.  In a couple cases it was exceptionally weird because MC wouldn't acknowledge it's own sidecar files which I verified were in the right spot.  Regardless, it made me gunshy about using a "tear-down and rebuild" approach unless I need to.

Even when the fix broken links method works perfectly for most metadata, it still borks a few fields. For example, it counts as a "fresh" import which blows away the old date imported value which I use for several of my audio views (I get through a lot of music, so being able to see things in the order they came in is important for my sanity).  I'm also pretty sure it resets play counts, but I'd need to test to prove that (I know for a fact that some library operation I did about a year ago reset all my play counts, and I'm pretty sure it was fix broken links related).
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Import PC library to Mac
« Reply #11 on: October 21, 2015, 06:43:56 pm »

Thanks for the extra details on your experience mwilliems.

A caution for anyone else that might be thinking of trying this:

Importing a PC library in MC for Mac screwed up my configuration on my main library.  Not horribly.  But rather inconvenient.  So far I found that importing the PC library:

Destroyed all of my zones and reconfigured the main "player" zone.
Dropped all of my saved Views (in View > Load/Save View).
Added weird directories into MC21's directory *and* in Documents.  A consequence of backslashes in those directory names I think.
Disabled Media Network, even though it was turned on.

Getting Cover Art and Thumbnails to have the correct names again is particularly painful.  :(

Restoring a library backup from a few days ago only fixed the views.  Everything else had to be fixed manually.  Not a huge big deal.  But inconvenient and disconcerting.  So, proceed at your own risk if you have an existing configuration on MC for Mac.

Brian.
Logged

Jumpsturdy

  • Junior Woodchuck
  • **
  • Posts: 60
Re: Import PC library to Mac
« Reply #12 on: October 25, 2015, 01:19:50 am »

I was able to do this with "rename, copy, and move" library tool, and then finding and replacing the changed portions of the file path. What I did was copy the reversed leaning backslashes for the mac along with the rest of the path to the folder holding the music and had that section of the file path copied to each file path entry. It worked, but took a while; probably no faster that the first method suggested.
Logged
Pages: [1]   Go Up