[livesupport-dev] RFC - upgrades
  • Hi,

    there probably should be some mechanism for upgrades without forcing
    users to reset LiveSupport database - mainly when we change DB structure
    or add some default data.
    (I don't know about any suitable standard system for it.)

    My suggestions to solve it:

    1st way (more similar to DB reset):
    - export DB to XML format
    - reinstall DB to new structure and insert default data
    - import data from XML file back to the DB
    (we probably need export/import anyway)

    2nd way (IMO better, more complicated):
    There have to be some states of DB structure during development and
    "patches" for migration to next newer state.
    Example:
    - user have installed and started using LS of some version when DB
    structure is in state A
    - development continues to states B and C
    - with each new state is provided "patch" file for upgrade DB
    structure (ALTERs, UPDATEs)
    - user want to upgrade to new version (with DB state C)
    - there is stored info about state of DB structure somewhere
    in the LS (state A now)
    - after upgrade will be automatically aplied all remaining
    "patches" A->B, B->C

    Is it possible/usable ... ?
    Any ideas or comments are welcome.

    Tomas Hlava
    th@red2head.com

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • 1 Comment sorted by
  • Tomas Hlava wrote:
    > there probably should be some mechanism for upgrades without forcing
    > users to reset LiveSupport database - mainly when we change DB structure
    > or add some default data.
    > (I don't know about any suitable standard system for it.)
    >
    > My suggestions to solve it:
    >
    > 1st way (more similar to DB reset):
    > - export DB to XML format
    > - reinstall DB to new structure and insert default data
    > - import data from XML file back to the DB
    > (we probably need export/import anyway)
    >
    > 2nd way (IMO better, more complicated):
    > There have to be some states of DB structure during development and
    > "patches" for migration to next newer state.
    > Example:
    > - user have installed and started using LS of some version when DB
    > structure is in state A
    > - development continues to states B and C
    > - with each new state is provided "patch" file for upgrade DB
    > structure (ALTERs, UPDATEs)
    > - user want to upgrade to new version (with DB state C)
    > - there is stored info about state of DB structure somewhere
    > in the LS (state A now)
    > - after upgrade will be automatically aplied all remaining
    > "patches" A->B, B->C
    >
    > Is it possible/usable ... ?
    > Any ideas or comments are welcome.

    while the first one is really simpler, it would require a total dump of
    database contents when upgrading (might be a slow process, requiring a
    lot of disk space). but then again, everyone running a serious system
    should do regular backups Smile

    the second is more risky, and takes a lot more effort, IMHO. with risky
    I mean that there might be the possiblity of data loss even, if the data
    conversion fails somehow. so we'd have to suggest the users making a
    backup anyway before doing an upgrade - so we're back to square 1...

    ------------------------------------------
    Posted to Phorum via PhorumMail