moving the database file to a shared location? (1 Viewer)

lanceuppercu

Portal Pro
January 13, 2008
142
1
London
i have my movies stored on a NAS and have 2 machines which i want to share a single database (it makes it easier when i edit/update it) for moving pictures. the complication is that both machines also have the tv series plugin which has different shows that have been "watched" so the databases will be different (depending on who has watched what) and will need to be stored locally. is this even possible?

also, is there any restriction on the database file when accessing from more than 1 computer at the same time? (for example i know outlook locks PST files when its open so nothing else can access it)
 

wb228

Portal Member
November 8, 2007
20
2
I tried the databases shared and hit all sorts of problems. What I did in the end was:

1. Setup a shared database folder.
2. Use a program called SyncBack to sync the database to a local computer when it turned on (before loading MediaPortal)
3. SyncBack when logged out back to server, preserving watched flags etc.

I do this with all databases and thumbs folders as well, meaning I can add new movies / TV series on one PC and the thumbs are carried over as well...

Only one issue with doing it this way - which is if you have two PCs on at the same time. one will override the other on logout so if you watch movie A on PC 1 and movie B on PC2, when syncback runs it takes the latest, meaning you will lose the watched flag for the movie on whichever PC was turned off first.

Of course, you can start watching a movie in the living room. Stop half way, turn computer off. Turn bedroom PC on afterwards and continue where you left off.
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    i have my movies stored on a NAS and have 2 machines which i want to share a single database (it makes it easier when i edit/update it) for moving pictures. the complication is that both machines also have the tv series plugin which has different shows that have been "watched" so the databases will be different (depending on who has watched what) and will need to be stored locally. is this even possible?

    also, is there any restriction on the database file when accessing from more than 1 computer at the same time? (for example i know outlook locks PST files when its open so nothing else can access it)

    There is no hard lock on the database file, so corruption can occur very fast when more then one computer uses MovingPictures on the same file. So as wb228 explained, you can keep a central database, but then copy it to each system before you launch MediaPortal.

    Note: This only works if both systems access the movies the same way, because a "D:\Movies\blabla.avi" will only work on the one that has that movie on the D: drive. You can however use UNC tricks, because "\\ComputerA\Share\blabla.avi" will work from ComputerB, but also from ComputerA itself.

    The MP-TVSeries plugin uses a seperate database, so you can simply ommit that from the database sync.
     

    WhyMe

    Portal Member
    July 26, 2008
    718
    12
    Home Country
    France France
    Re : moving the database file to a shared location?

    Use shared database for MP and plugins will uses same directory !
    My 3 MP clients use same databases for MP, MovingPictures and MPTVSeries, located in a share on my server.
    No problem with this config.
     

    lanceuppercu

    Portal Pro
    January 13, 2008
    142
    1
    London
    There is no hard lock on the database file, so corruption can occur very fast when more then one computer uses MovingPictures on the same file. So as wb228 explained, you can keep a central database, but then copy it to each system before you launch MediaPortal.

    Note: This only works if both systems access the movies the same way, because a "D:\Movies\blabla.avi" will only work on the one that has that movie on the D: drive. You can however use UNC tricks, because "\\ComputerA\Share\blabla.avi" will work from ComputerB, but also from ComputerA itself.

    The MP-TVSeries plugin uses a seperate database, so you can simply ommit that from the database sync.
    i'd like to get this working without having any additional sync jobs running.

    what gets "corrupted" exactly when more than 1 computer tries to use(/access?) a shared database at the same time? thinking about it and to be honest, the watched flags and such arent an issue when it comes movies --movies, you've either seen them, or you have. the sheer volume of tv series means the watched flag is essential, which is why i wanted to stay with a local database for that.

    infact i'd like it if the 2nd machine was only able to run moving pictures to how i've set it up on the 1st machine (view/sorting/title art etc) but not be able make any changes to it (i could do this via folder share permissions), is that possible?

    if so, how do i go about setting up the shared database (and the folder for the downloaded backgrounds etc) whilst leaving the tv-series setup as it is?

    it would be greatly appreciated if someone could do an easy to follow guide, assume i have a share called \\server\tv and i've set the permissions accordingly so that the windows login called: admin has full modify permissions and media login only has read only rights.
     

    WileECoyote

    MP Donator
  • Premium Supporter
  • October 14, 2008
    1,156
    220
    Cary, NC
    Home Country
    United States of America United States of America
    Hey lanceuppercu,
    What I have done is set up a share on my server and modify the MediaPortalDirs.xml file on every machine and change the Database entry to point to the share. Be aware that if you make this change all your databases need to reside on the share (Moving Pictures, TV Series, etc...)

    If you want to explore this way simply change "%ProgramData%\Team MediaPortal\MediaPortal\Database" to point to your share (i.e. \\MachineName\ShareName.) You can optionally change the Thumbs entry to point to a shared thumbs folder (I do this so all my TV Logo's, TV Series Images & Moving Pictures Images, etc, are in a central location.)

    I have had no corruption issues with this setup thus far.
    Wile E.
     

    lanceuppercu

    Portal Pro
    January 13, 2008
    142
    1
    London
    Hey lanceuppercu,
    What I have done is set up a share on my server and modify the MediaPortalDirs.xml file on every machine and change the Database entry to point to the share. Be aware that if you make this change all your databases need to reside on the share (Moving Pictures, TV Series, etc...)

    If you want to explore this way simply change "%ProgramData%\Team MediaPortal\MediaPortal\Database" to point to your share (i.e. \\MachineName\ShareName.) You can optionally change the Thumbs entry to point to a shared thumbs folder (I do this so all my TV Logo's, TV Series Images & Moving Pictures Images, etc, are in a central location.)

    I have had no corruption issues with this setup thus far.
    Wile E.

    right okay so i'll edit the thumbs entry like that, so that it is pointing to the shared drive. but i'll need only the moving pics database on the shared drive though.
     

    Users who are viewing this thread

    Top Bottom