How to change path in DB (1 Viewer)

JohnDoe2000

Portal Pro
July 10, 2007
73
0
Hi all,

I would like to change the path of the already stored and imported movies.

For instance:

I imported the move geh.avi with the following path: X:\abc\def\geh.avi and want to chance it to \\server\def\geh.avi

To change the path I edited the tables local_media and import_path. I've done this with the following two statements:

update local_media
set fullpath = replace(fullpath, 'X:\abc', '\\server')
where fullpath like 'X:\abc%'

update import_path
set path = replace(path, 'X:\abc', '\\server')
where path like 'X:\abc%'

BUT if I start the configuration of MovingPictures the movie geh.avi will be imported again.

Have I forgotten anything? Is there another table I have to edit?

Would be great if anyone could help me.

thx and regards,
JohnDoe
 

JohnDoe2000

Portal Pro
July 10, 2007
73
0
Hi,

and thank you for you fast answer. I tried to change the path following the linked description but it doesn't work. I think I know why. OK, here is an additional and important information:

X:\abc\ is a mounted network device witch points to \\server\. Because of this it is not possible to move the files. The files stay where they are.

Sorry, that I didn't mentioned it but I thought that this isn't important.

Do you have any advice to chance the directory?

Thank you in advance.

Regards,
JohnDoe
 

JohnDoe2000

Portal Pro
July 10, 2007
73
0
If I use the configuration to do this all movies will be reimported like the first time. If I do it hard in the Database I get a NullReferenceException the next time I start the configuration.

Long story short: It doesn't work.

Any other suggestions?
 

HomeY

Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    What if you do the following:
    1. Change the drive letter in Windows, for the mapped network drive
    2. Start MovingPictures Config
    3. Add the network share \\SERVER\....
    4. Check if the paths for the movies are updates
     

    JohnDoe2000

    Portal Pro
    July 10, 2007
    73
    0
    Same again. The Configuration is going to import the movies again. After step 3 I have 2 entries for the movies. The movie from the device is marked red and the other is a new import of the same movie. And the movies are importes as the first time so I have to correct some entries.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Same again. The Configuration is going to import the movies again.

    You will have to do it 3-fold, due to the recursive folder structure.

    (Could only match the local and UNC paths to your censored explanation, so pay attention that you do it correct)

    Step 1:
    • Create "X:\abc\Temp"
    • Move all the files+folders from "X:\abc" into "X:\abc\Temp"
    • Allow MovPic config to update the path reference (no movie should reimport, unless the hash calculation was corrupt)
    • Edit import path to become "X:\abc\Temp"
    Step 2:
    Step 3:
    • Remove "X:\abc\Temp" import path and close MovPic config.
    • Move all the files+folders from "\\server\Movies" to "\\server\"
    • Allow MovPic config to update the path references one more time (no movie should reimport)
    • Close MovPic config and delete the Temp + Movies folders.

    And done.
     

    JohnDoe2000

    Portal Pro
    July 10, 2007
    73
    0
    Hi,

    works like a charm. Thank you very much!

    Best regards,
    JohnDoe
     
    M

    mjmapi

    Guest
    This might be old, but for some that still go through this headache every-time they make changes to their drives, the DB edit route always proves easier for me.In my case i was changing my paths to a network share

    to edit the TV Series DB, two tables must be edited

    update local_episodes
    set EpisodeFilename = replace(EpisodeFilename, 'D:\Series', '\\192.168.2.197\Series\Series')

    update local_episodes
    set volumelabel = replace(volumelabel, 'Series', '192.168.2.197\Series\Series')
    //my old local folder drive was named series, this must also be changed to the network folder, don't include the '\\'

    update importpathes
    set path = replace(path, 'D:\Series', '\\192.168.2.194\Series\Series')

    you can run some selects on the following tables to verify that all has been changed

    select * from
    local_episodes

    Select *
    from importpathes


    Make Changes to the Moving pictures Db

    update local_media
    set fullpath = replace(fullpath, '\\E:\Movies','\\192.168.2.197\Media\Movies\Various')
    //This changes the file-names prefix, appending it with the new path

    update import_path
    set path = replace(path, 'E:\Movies','\\192.168.2.197\Media\Movies\Various')

    update local_media
    set volume_serial = ''
    //My local was set to Movies, the name of my HardDrive, i removed this

    Hope this helps someone that might have also struggled as i did
     

    Users who are viewing this thread

    Top Bottom