Sync databases by Media Sync Service (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    12,426
    7,120
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #21
    I need sync all this DBs
    upload_2019-2-14_21-19-45.png
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    250
    37
    United Kingdom United Kingdom
    Country flag
    Hi ajs

    The Media Sync Service does synchronize all movie information in one VideoDatabaseV5.db3 with other VideoDatabaseV5.db3 files; well, it does for me anyway.

    As I said, I am only interested in synchronizing VideoDatabaseV5.db3. It seems like this will not be enough for your needs.

    Sorry about that.

    Tony
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    250
    37
    United Kingdom United Kingdom
    Country flag
    Hi ajs

    I have some time to look at syncing other MediaPortal databases than VideoDatabase5.db3.

    Just to be clear, my syncing app does not simply copy a .db3 file that has been updated in one folder to all other relevant folders. My app programmatically ensures that all of the data in the changed database is up-to-date. This approach takes quite a bit of coding and is not trivial.

    Therefore, I need to know what databases you REALLY need to synchronize because it will take me some time to program.

    I am going to start with the FolderDatabase3.db3 because I only need to update two tables.

    If you want me to have a go at your databases please let me know which ones to look at first and I'll get back to you - don't forget to let me know which app uses each database so I'll know how to load it into my system.

    Update: I forgot to mention that my sync app also maintains the VideoDatabaseV5.db3 database; i.e. when physical video files or folders are deleted, references to those files/folders in the VideoDatabaseV5 database are also deleted. I notice that FolderDatabase3.db3 on my system have many references to non-existent files and folders, so I'll have to ensure that only current files and folders remain in the database. The FanartHandler.db3 database has a similar issue and I also have found numerous images on my hard drives related to films that I have actually watched and deleted.

    Tony
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    12,426
    7,120
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #24
    Therefore, I need to know what databases you REALLY need to synchronize because it will take me some time to program.
    It is not strange all the databases. When there are 4 HTPCs, I want flexibility and convenience. :):whistle::coffee:
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    250
    37
    United Kingdom United Kingdom
    Country flag
    I just want to be clear about what I have been saying about synchronizing the SQLite databases in MediaPortal1.

    The easy way to synchronize client databases across more than one client is to use file watchers on the client folders to detect changes to the database last write time and to copy the changed databases to all of the other client folders. This would be fine if MediaPortal1 didn't lock the databases - you could simply code for any databases changed to be passed forward to all clients. This would be simple, easy and quick to code, and will work, so long as you never run more than one client at the same time.

    However, MediaPortal1 locks the VideoDatabaseV5.db3 database for example, once it has been invoked, throughout the entire client session. The effect of this is that, when two or more clients are accessing MediaPortal at the same time, lets call them Client1 and Client2, Client1's changes will be locked when Client2 closes thus preventing Client2's changes being copied to Client1 (because Client1s files are locked). When Client1 closes, its changes will then overwrite the Client2 databases effecting losing all of the changes recently made by Client2.

    My solution to this was to copy all changes made by Client1 and Client 2 to a separate (Sync) database and to copy the changes in the Sync database back to the client databases when the client session closes. If a client is open when another client closes, the changed database files are copied to a queue folder instead of directly to the clients and updates all client databases as soon as no clients are running (i.e. when there are no locks). This solution involves a lot of coding. I've been running my solution for at least a year and a half and it works pretty well. This solution is truly multi-user compliant.

    If there is a better, and easier, way to overcome this multi-user issue then I'm all ears.

    In the meantime, I am going to start using Fanart and intend to extend the databases I will cover in my app from just VideoDatabaseV5 to include FolderDatabase3 and FanartHandler.

    I am happy to use this system just for myself, but I thought I would be friendly and offer it to anyone else who might be interested. I don't need anyone to be a tester. But this will not be a perfect solution for everyone, so please understand that. I will only offer what I am personally interested in using and developing.

    Tony
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    12,426
    7,120
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #26
    to detect changes to the database last write time and to copy the changed databases to all of the other client folders
    DB Locked, how copy when all client work, but i add NewMovie to DB?
    My solution to this was to copy all changes made by Client1 and Client 2 to a separate (Sync) database and to copy the changes in the Sync database back to the client databases when the client session closes. If a client is open when another client closes, the changed database files are copied to a queue folder instead of directly to the clients and updates all client databases as soon as no clients are running (i.e. when there are no locks). This solution involves a lot of coding. I've been running my solution for at least a year and a half and it works pretty well. This solution is truly multi-user compliant.
    Like MPSync, but MPSync, sync changes on fly, from master to server and from server to slaves ... But I would like to be from a master and a slave. So that the changes on any computer are immediately synchronized through the database on the server to other computers. :coffee:
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    250
    37
    United Kingdom United Kingdom
    Country flag
    Like MPSync, but MPSync, sync changes on fly, from master to server and from server to slaves ... But I would like to be from a master and a slave. So that the changes on any computer are immediately synchronized through the database on the server to other computers. :coffee:
    That's exactly what my app does. It updates clients in real time. The down-side of that is that you need to have the machine running the sync app up all the time. BTW, I recommend that that machine not be the TV Server machine because the TV Server uses a lot of resources.

    Tony
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    O Steps to achieve AV sync - please tell me I'm missing something General 0
    A Question about Google Drive sync Feature Requests 3
    Glith Audio out of sync after pause. Rewind 15sec gets it into sync again. MediaPortal 1 Talk 0
    A Audio sync problems on LAV filters 1.21 Pre Release 31
    fischy667 wrong/no sync with trakt on some series Trakt 2
    W Sync Fehler Allgemeines Support- und Diskussionsforum 1
    A AAC 2.0 going out of sync Codecs, External Players 2
    toricred Using TMM, How to Stop Importer From Going to The Movie Database for Data General 1
    H MP2 database won't keep in synch with recordings General 8
    F How to reset tv recordings database General 5
    A Synchronizing client databases MediaPortal 1 Talk 10
    R Problems accessing MySQL database remotely MediaPortal 1 Talk 0
    globaldonkey Music Database Error Listen Music 1
    R [solved] Files moved to new location - Easy way to update database? My TVSeries 7
    R Files moved to different location - Easy way to update database? Moving Pictures 2
    H [solved] Video database genres, sort titles and collection thumbnails Newcomers Forum 12
    G MP1 TV Server "failed to upgrade the database" using MS Sql Server Installation, configuration support 3
    D PC rebuild & MP2 upgrade - how to preserve database and settings? General 1
    H MP1.21F video database scan, can it be scheduled to automatically run in background General Support 5
    D Large xml database in My Movies Management. I remain unclear on use My Films as bridge to MP2.2 General 9
    J Database schema General 0
    W [solved] MP 1.20 Video IMDB no showing plot General Support 129
    hounddog How to get My Films working in MP 1.20 My Films 5
    C How well can MediaPortal handle 10,000+ recordings? MediaPortal 1 Talk 3
    H Database migration Archive 85
    Similar threads

























    Top Bottom