INTERACT FORUM

Please login or register.

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

Author Topic: Best way to merge multiple libraries into one  (Read 2704 times)

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887
Best way to merge multiple libraries into one
« on: April 15, 2015, 10:59:00 pm »

Someone I am helping has his MC in a mess. He's using multiple libraries for each of the different sources his audio files are from.
I will be helping him merge the libraries into one Master version, with different Users for each of the different sources (because he wants them to be separate), and zones set up to play these files to the best of their ability via a AES DAC or HDMI.

So, what is the best way to merge libraries? Should I simply clone the largest one, and then import the files again into the clone, assign users etc? Or is there a way to merge libraries? Thanks in advance for your responses.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Best way to merge multiple libraries into one
« Reply #1 on: April 15, 2015, 11:12:48 pm »

Should I simply clone the largest one, and then import the files again into the clone, assign users etc?

Probably.  Make sure to write all tags they care about to the files first.

There have been other attempts.  I know MrC helped someone with it in the past, and you might want to look for some of his old threads on the subject, but... It wasn't very clean.  If possible, I'd just re-import the files from the smaller, auxiliary Libraries. Otherwise, you're looking at scripts to export metadata and importing and...  ::)

How about a nice game of chess, instead?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887
Re: Best way to merge multiple libraries into one
« Reply #2 on: April 15, 2015, 11:29:07 pm »

Thanks glynor. That is close to the worst case scenario, but I guess it must be done. I wish there were a merge libraries feature, but I am probably expecting MC to read my mind in many cases.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Best way to merge multiple libraries into one
« Reply #3 on: April 16, 2015, 12:08:39 am »

There are two strategies you can use here, to make it less painful.  First, before you do any of this crap, make a backup of ALL of the Libraries.  If I was ever stuck in a similar situation, I'd probably use method #2, but... It is up to you.

1. Via File Tags

1a. Ensure that all of the fields you care about are set within MC to be written to the in-file tags (this is a PITA, you have to go through Tools > Options > Library & Folders > Manage Library Fields one by one and make sure Save in file tags is enabled).

1b. Ensure that all of the files in the Library are in a format that can store in-file tags that can be read by Media Center. This is easier now that MC supports reading and writing tags in more file formats, like WAV and whatnot.  But if you have any esoteric file formats in there, then this method won't work.

1c. Select all the files, Library Tools > Update tags (from Library)

1d. Switch to the new "owner" Library, and import the files.

This will not import Playlists or Media Views, however.

2. Via a MPL

2a. This method might be more reliable and easier to pull off, but it doesn't put a "backup" in the file tags (which might be a valid goal in any case).

2b. Make a Smartlist that includes all files in the Library.  I use this as the Smartlist search for mine: ~sort=[Filename]

2c. Select this Smartlist in the Tree and Right-Click > Export Playlist.

2d. In the Export Playlist dialog, pick MPL Playlist as the Format.  Make sure that the Store paths relative option is unchecked.

2e. Switch to the Library you want to import the files into. Import this MPL file into this Library within MC via File > Import Playlist.

That should import the files and ALL existing metadata except a few items that are "intrinsic" like [Date Imported].  I don't know what it will do to Linked Tracks, Stacks, and Particles, though, so if they've made substantial use of those features, caution may be warranted.

If you need to import any ordered Playlists after the fact, you can do the same with those (make MPL lists and then import them). Do that afterwards, though, and make a "master" MPL to import the files themselves first (probably doesn't matter technically, but I'd do it this way to be safer).

Smartlists and Media Views will need to be recreated by hand. I'd recommend saving the Search strings from any Smartlists to a text file (clearly labeled) and then making them in the new "owner" Library from your text document.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Best way to merge multiple libraries into one
« Reply #4 on: April 16, 2015, 12:15:03 am »

In any case...

That's why you shouldn't make separate Libraries unless you're absolutely-positively-come-heck-or-high-water sure you won't ever need to use the sets of files at the same time.  Separate Libraries can be useful, but mainly for wildly different file sets.

I know you probably know this.

Also, I'd exercise caution if the separate Libraries may, in some circumstances contain references to the same physical files on disk in multiple spots.  In other words, what if the metadata conflicts?  Using Method #2 above, you'll end up with (I believe) the metadata from whichever MPL file you import last.  Though, I haven't tested it, so I'm guessing.  It might ignore changes to files that already exist in the Library when you import a MPL, but I don't think so.

Assuming I'm right, and the "last one wins", then add in a step 0 where Before You Start, you create an All Files MPL for the Library you choose to be the "winner" for the files that do conflict.  Then, when you're all done, import that last MPL file to "put everything you had originally back to the way it was" in the new Merged Library.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887
Re: Best way to merge multiple libraries into one
« Reply #5 on: April 16, 2015, 09:56:29 am »

Thank you SO much for all this information. I wish I'd had access to a computer more last night, and I would have provided a bit more info.
Thankfully, the guy is a newish user of MC, so his libraries are all fairly raw. He's a music reviewer for an audiophile magazine, so I want him to have the best possible experience with MC. I don't think any of them have custom tags whatsoever, but I will check. Therefore, I think the process may be a little bit easier than when one must cater for all the provisos that you so kindly thought about in your answers.
I will try to do everything in a non-destructive manner, so that he could theoretically go back to the way things were.
Logged

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887
Re: Best way to merge multiple libraries into one
« Reply #6 on: April 16, 2015, 11:43:41 am »

Bad news: I was wrong about custom fields and this being a relatively new user.
Good news: All tags are written to files

Other bad news: It appears the [user] field is not written to files, or cannot be read on import.

This is a nightmare task, since the user had moved album folders in Windows Explorer, after importing them in MC. Just spent 4 hours working on it before understanding this. We will need to just reimport everything afterall, and then figure out tagging based on file location and filenames.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Best way to merge multiple libraries into one
« Reply #7 on: April 17, 2015, 12:00:15 am »

So he has a bunch of broken links in the various Libraries?  In other words, he tried to merge them on disk himself, and the source files are now all mixed together and all the links are broken?  Ugh.  I almost mentioned up above to make sure not to try to move the files around on disk until you were all, completely, totally done (then just Rename, Move, Copy them to whatever final destination you want).

Wow. Nightmare hellride.  If a bunch of the Libraries have a portion of files that aren't broken links in MC, you can still use method #2 above to preserve metadata on whatever is left and not broken.  Then, just auto-import what is left at the end.

So:

0. Seriously, make Library Backups of each Library first and save them somewhere safe.
1. DO NOT MOVE ANY MORE FILES ON DISK UNTIL YOU ARE DONE.
2. Pick whichever Library is in the best shape to begin with and use a clone of that as your new Master Library.
3. Maybe, try to fix as many of the broken links as are possible in the Master Library with Rename, Move, and Copy files in "update database only" mode.
4. Then open up one of the to-be-deleted Libraries and get ready to make your MPLs.
5. Before you start, make an IsMissing Smartlist, select all, and remove them from the Library (assuming they can't be easily fixed by doing Rename, Move, and Copy in "update only mode").
6. Do the MPL exporting/importing steps I outlined above.
7. Repeat for all other to-be-deleted Libraries.
8. Return to the Master Library, and run a final import to grab the rest.  When you do this import, set a Tag On Import rule to auto-tag all of the new files with some [Keyword] or something you can search for later (to "separate" them from the stuff you saved via the monkey-steps above).
9. Make a final Smartlist to show just those files with the keyword you made when you imported them.
10. Finally, use the Fill Properties from Filename tool to save as much metadata as you can get from the file/folder structures on disk.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up