PDA

View Full Version : How to maintain metadata when moving data files



waffull
11-03-2010, 02:45 AM
I need to move a couple TBs of movies/music from the HDs they are on over to other HDs and a NAS. Does anyone know how I can maintain the metadata that I've already entered in Mezzmo (genre, year, cover art, etc?) I've already had to redo all of that once when I went from the trial to paid version. I'm not looking forward to doing it again and possibly multiple times in the future as I need to move data around.

Thanks for the help,
Marc

Paul
11-03-2010, 08:51 AM
Are you just changing the drive letter or the folder structure as well?

waffull
11-03-2010, 09:00 AM
Drive letters definitely. The folder structure that contains the files will remain the same, but above that may change. IE: 'c:\users\%username%\videos\tv' becomes 'h:\videos\tv' and 'e:\movies' becomes 'h:\videos\movies'. But '..\tv\west wing\season x' remains the same.

Paul
11-03-2010, 09:07 AM
The only way to do this is to manually change the database's records - if you're comfortable with that, I can tell you what program to download and what SQL commands to enter to achieve this.

waffull
11-03-2010, 09:12 AM
Yes, I can do that. I've worked with sqlite and mysql a bit, so with your guidance I'm sure I can do that.
Thank you..

Paul
11-03-2010, 09:58 AM
Ok, first step is to make a backup of your Mezzmo.db :) and of course stop the server, shut down Mezzmo.

Then download the sqlite3.exe command line tool from here: http://sqlite.org/download.html (the precompiled binary for Windows).

After that copy it to the same folder as Mezzmo.db and run:


sqlite3 mezzmo.db

this should give you a database prompt. There enter:


update mgofile set file=replace(file,"C:\Users\blah\Videos\","H:\Videos\") where file like "C:\Users\blah\Videos\%";

Please make sure that the second parameter in the replace() function is exactly as it's in the database, because this function is case-sensitive.

Let me know how that goes.

waffull
11-03-2010, 11:38 AM
Worked like a charm, thank you. I used http://sqlitebrowser.sourceforge.net to see the exact paths which were already in the db in order to get the cases correct. After running the update command for all folders, I then opened Mezzmo and changed the folder locations for the folders I had added. Checked the metadata and it all appears to be there.

Thank you for your help.
Marc

Paul
11-03-2010, 11:40 AM
Glad to help and hopefully this will help others as well.

steppinwolf
12-21-2011, 11:42 AM
I successfully updated strings in mezzmo.MGOFile.file about a year ago, but now when I try the following query it returns "Error: column file is not unique":

update MGOFile set file = replace(file, 'D:\', 'F:\') where file like 'D:\%';

Tried double quotes, the mezzmo service is stopped and select * from mgofile where file like "D:\%"; confirms the existence of the string. All I need is to change the drive letter...

Paul
12-21-2011, 05:01 PM
It needs double-quotes, but you tried that. Strange, it should work. Which database browser/editor are you using?

steppinwolf
12-27-2011, 02:04 AM
Yes, I started off using double quotes then tried single. I used SQLite shell version 3.7.9 from SQLite.org and also tried sqlite admin 0.8.3.2...

Update: Whoops, I should have thought of this before. Soon after assigning a different volume letter to my media drive, I instinctively rescanned the folders in question, went off to do something else and forgot about it. Of course now it's obvious the "not unique" error is due to the path already existing. The fact that I added files as a playlists the first time and as folders this time made it less obvious. Sorry, hope I didn't waste too much of your time!

Paul
12-28-2011, 11:58 AM
Happy to hear you have it all sorted out now.