[other] Add database safety (1 Viewer)

Requiem

MP Donator
  • Premium Supporter
  • January 1, 2012
    588
    216
    Home Country
    Germany Germany
    Hi,

    first, let me say, I am just an experienced user but not a pprogrammer in any way, so I don't know if my suggestion is a good idea or not.

    I have been using MePo for a good while now and I like it very much, especially it's expandability and customizability. But it has happened to me several times now that unexpected errors occured - the most severe due to corruption of any of the databases. So my idea was to add a kind of database security by adding a backup of all database files which should be updated after either a) after a verified successful modification or b) after a specified time period.

    a) Would be nice, but hard to achieve, as every addon author would need to use these routines,
    b) could make backups on every startup of MePo into a subfolder (add date/timestamp to filename) and you could set in config e.g. "max 20 copies" or "max x mb disk space" before the old entries become deleted.

    So, if a database gets corrupted, you could simply go back to an older, hopefully not yet corrupted version.
    I have saved myself from reinstalling or at least rebuildiung databases several times by my daily incremental backups, but I suppose not everyone does these.
     

    regeszter

    Retired Team Member
  • Premium Supporter
  • October 29, 2005
    5,335
    4,954
    Home Country
    Hungary Hungary
    Hi,

    are you talking about the my videos/pictures/music and folder databases or tv databases or anyting else?
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    In general databases should not corrupt that often so backing up all the time just because of this is not a real solution. Funny thing is that for example SQLite says that it is "highly resistant to corruption". Like regeszter suggested it would be nice to know what DBs you are having problems with.
     

    Requiem

    MP Donator
  • Premium Supporter
  • January 1, 2012
    588
    216
    Home Country
    Germany Germany
    Yes, basically about all database files in \ProgramData\Team Mediaportal\Mediaportal\Database (and corresponding folder for the TV server part).
    My experience was that this seems to be quite vulnerable for database corruptions, this leading to crashes of MePo. I've experienced this several times, sometimes due to a HTPC reset/freeze at the wrong moment, due to a buggy plugin, sometimes du to a MePo crash to other causes, sometimes without an explanation for that. Restoring the databases almost always restored full functionality, but if you have no backups, you're screwed...

    I agree on the "should not" part, but my experience is another, especially when you customize many things with plugins which come with more databases etc.
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    TV Server part is a bit different since it uses "real" databases like MySQL/MSSQL Server and especially now that MySQL is using InnoDB engine as default it should be more robust.

    I'm not sure why SQLite corrupts so easily, I know that there are threads here in the forums almost every week where someone has messed up DB..
     

    Requiem

    MP Donator
  • Premium Supporter
  • January 1, 2012
    588
    216
    Home Country
    Germany Germany
    Okay, then for the client part. Indeed, never had problems with TV server part. But as you said, there are several threads about corrupted databases (either MePo itself or plugin related, which does not really matter if the result is MePo crashing). So, especially for the not-so-experienced user, maybe some kind of backup- and restore functionality would be nice. Or, if achievable, a more stable database.
     

    Users who are viewing this thread

    Top Bottom