export movingpictures db to mySQL (1 Viewer)

winniwinter

MP Donator
  • Premium Supporter
  • January 5, 2009
    162
    3
    Freiburg
    Home Country
    Germany Germany
    Hi,

    currently I'm trying to export the MovingPictures database to my server. I want to be able to access the data even If my client is not available. Therfore I'm currently trying to create a little WebGui which will allow me to browse throw my movies and watch them directly without mediaportal.

    My Plan is to export the sqlite data to my mysql db. For development I just wanted to dump the sqlite data and import it to my MySQL db. But that's sadly not working as I thought it would be. Does anyone of you did this before?
    I exported the DB with the firefox "SQLITE Manager" addon and changed some notations like " to ' but the MySQL Workbench still won't import the dump. It doesn't get even listed as a valid dump since it says that the dump.sql doesn't contain any tables.. :mad:
     

    fforde

    Community Plugin Dev
    June 7, 2007
    2,667
    1,702
    44
    Texas
    Home Country
    United States of America United States of America
    Do you just hate SQLite or something? It is not a suitable database for a website with hundreds of concurrent visitors, but for your purposes it should be fine.

    By the way, are you familiar with http://follw.it?
     

    winniwinter

    MP Donator
  • Premium Supporter
  • January 5, 2009
    162
    3
    Freiburg
    Home Country
    Germany Germany
    AW: export movingpictures db to mySQL

    do I hear some sarcasm? :)

    I don't hate SQLite BUT my problem is that normally if I want to access my data the client is offline and I'm sitting in front of my laptop. All my files are stored on my server which is running 24/7.
    At the moment I then browse through the directory of the server. But I would love a web-interface where I can browse through my files using the **** data which are stored in the sqlite db...I want to browse through the list and than directly open a file.

    So what could I do? Always copy the sqlite db to my server? I tought since I have already a mySQL db installed I could push the client data from the sqlite db to my MySQL db.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Syncing the sqllite db to a MySQL database is no different really to just syncing the sqllite database (ie. Copying the whole file)

    Not sure what benefit you are getting from putting the data in a MySQL database?
     

    fforde

    Community Plugin Dev
    June 7, 2007
    2,667
    1,702
    44
    Texas
    Home Country
    United States of America United States of America
    It is not a suitable database for a website with hundreds of concurrent visitors
    In fact it's main problem is the inability of concurrent access(like in multi seat setups...)

    SQLite handles multiple clients perfectly fine, it just has a few limitations which stem from it's locking mechanism.

    When modifying the database SQLite uses the filesystem to create a lock. This works very well for a small number of clients performing relatively quick operations, but it becomes problematic when you have hundreds of clients or when you are performing lengthy operations on the database (neither case really applies to us). A more robust database platform could lock at the table level or even the row level when making data changes, allowing other clients to concurrently access or modify other data. SQLite effectively locks the entire database when making a change, so when a large number of clients are involved some delays will begin to occur.

    The file system locking mechanism can also be a problem when dealing with a database on a network drive. Basically Windows sometimes incorrectly reports the state of a file's lock on a network drive, meaning that concurrent writes could occur causing database corruption. This as I understand it is a bug in Windows and it is one of the main reasons that ad hoc multiseat setups are problematic as you mentioned. However even if SQLite's locking mechanism were reliable across networks, there would still be issues with this sort of multiseat setup. Moving Pictures itself was simply not designed to have two clients accessing the database at once. It caches data from the database to improve performance which could cause data to be lost if a row is read then later modified in both installations. The correct solution would be a proper client / server setup in the Moving Pictures plugin.
     

    fforde

    Community Plugin Dev
    June 7, 2007
    2,667
    1,702
    44
    Texas
    Home Country
    United States of America United States of America
    Re: AW: export movingpictures db to mySQL

    do I hear some sarcasm? :)

    I don't hate SQLite BUT my problem is that normally if I want to access my data the client is offline and I'm sitting in front of my laptop. All my files are stored on my server which is running 24/7.
    At the moment I then browse through the directory of the server. But I would love a web-interface where I can browse through my files using the **** data which are stored in the sqlite db...I want to browse through the list and than directly open a file.

    So what could I do? Always copy the sqlite db to my server? I tought since I have already a mySQL db installed I could push the client data from the sqlite db to my MySQL db.

    Sorry I thought I posted this earlier, forgot to hit send:



    Sorry I was not trying to be sarcastic, just curious why you wanted to convert things to MySQL. Seems like an unneccesary extra step. If the issue is getting the data on your server why not just setup a process to periodically copy the SQLite database over, then access that directly? Pushing data from the main SQLite database to a MySQL database would of course work as well, but it seems to me like this would just be making things harder on yourself.
     

    winniwinter

    MP Donator
  • Premium Supporter
  • January 5, 2009
    162
    3
    Freiburg
    Home Country
    Germany Germany
    Hi thanks for your answer.

    First thing: Why the hell I'm doing this?!:

    I want to get more involved in the development part since I'm using MP now for quite some time. I'm a SAP ABAP developer and at the moment it's getting a bit boring and I want to get to know other dev languages.

    So, I'm a fan of mediaportal, I want to get involved in other languages...let's try to combine this. Now I searched for a common problem I have which is currently my situation. Stting in front of my laptop (non windows) and browsing through the movielist, directly select one movie and watch it (or even watch a trailer first? :) )

    Next step how can I do this:
    - Just copy the database to my server => Would solve my problem for the moment. But what if I want to do more in the future. Like editing stuff on my web-interface..
    - So what would be one solution: creating a process plugin that pushes the data to the already existing mySQL DB, now I can access the data and for the future editing it (at first just set the watched/unwatched toggle)
    - Now the client process plugin should not only push data to the server, also it should check for changes and update the database
     

    Users who are viewing this thread

    Top Bottom