How to move import folder (1 Viewer)

howudodat

Portal Pro
February 20, 2007
75
2
Home Country
United States of America United States of America
using V1.8.1.0, I am moving and upgrading my NAS. Previously my movie folder was set to \\NAS\MOVIES, during and after the move, the movie folder will be M:\ (mapped to \\NAS2\MOVIES). If I simply change the folder in the Movie Importer tab, will it re-import all the movies as their "path" will be different than before? Is there a way to change the movie folder without re-importing all the movies?

Peter
 

Collective

Portal Pro
July 13, 2008
104
55
Home Country
Australia Australia
just off the top of my head, if you add the new path to Moving Pictures before you move your movie folder, it should automatically update the path for each movie once you do move it without having to re-import. Then once it's done remove the old path.
I *think* that should work.... off the top of my head (translation: I could be wrong)
 

howudodat

Portal Pro
February 20, 2007
75
2
Home Country
United States of America United States of America
Thanks for that. I made a backup of the movie database first so I could rollback easily. I was concerned with two issues that popped up:
  1. I found that I ended up with dual entries for each movie in the database.
  2. When I went to delete the old path, it warned me that any entries pointing to the old path would be deleted...I got scared here
Here is what I ended up doing:
  1. Add new import path and quit settings
  2. make a backup of movingpictures.db3
  3. go back and do step 2 again :)
  4. open movingpictures.db3 in sqlite editor (I use sqliteman)
  5. select * from import_path. This gets you the "id" of the new import path...take note of this id
  6. select * from local_media. This is all the movies. Take a look around, get comfortable with the data that is there. The columns that are important are "fullpath" and "importpath". This is the data we will want to update.
  7. update localmedia set importpath=<id from step 3>, fullpath=replace(fullpath, '<old path part>', '<new path part>'). note: items in <> are variables that need entered. For MY CASE ONLY, the replace looked like:
    1. update localmedia set importpath=4, fullpath=replace(fullpath, '\\NAS\movies\', 'N:\');
  8. Start moving pictures settings config again (For some reason all the movies showed up red, I quit and restarted the config and it was very happy)
  9. remove old path.
I might not of needed to do all that, but in the end it worked. These instructions might be a bit much for those who are not comfortable with SQL.

Peter
 

Collective

Portal Pro
July 13, 2008
104
55
Home Country
Australia Australia
ah.... you probably had the original movie dir marked as removable, so it would not remove the entries automatically. But if it duplicated every movie, then you could have removed the old path without problem.
I'm one of those not comfortable with SQL, so I would have removed the path and seen what happened, especially since you backed up the db twice ;)
Glad you found another way though
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    MovPic uses hashes, so you could have just added M:\ as new import path (without it containing any movies by setting up fake UNC reference), close MovPic config, and then 'move' all the files from old import path to new one. When you relaunch MovPic config it will very quickly rescan all the hash codes found on the M:\ import path, recognize they are the same movies, and only update the path reference in all relevant dbase locations without having to do any SQL.

    Once moved over, then you delete the old import path.

    Each move entry is marked in the movingpictures.log, but in the MovPic config you can also visually see it happening with movies having a red color entry, and slowly they will all update to black. It is safer to verify in the movingpictures.log that the background/import scans completed though, especially on a large collection.

    PS: The option to remove an import path, but mark it as such was designed I believe to replace say D:\ with D:\, because for physical HDDs the volume/serial is also linked.
     

    Users who are viewing this thread

    Top Bottom