SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    0 Post(s)
    0 Thread(s)

    how to do upgrade ( copy schema + data) from old DB schema to new DB schema

    Hello All ,

    My name is ron i'm working on Web site project using MySql Database .

    currently we have a version of schema of DB with data for the site beta version .

    I have also newer DB schema for the new version of the site .

    i want to implement upgrade procedure to copy schema+data from one
    version to another version of my Database.

    my question : what is the best way to do the upgrade to the new schema +
    copy all the data from old DB version to the new DB version .

    1) Do i need to write script to create the new DB schema , and also script for all the insert statements ?

    2) If i want this upgrade procedure support transactions , let's say if the procedure of copy the data failed , then i want to Rollback to the previous version.
    Do i need to wite an application ( c# console ) to do this job ?

    3) Is there anyway of checking in the script if the Current DB version is older then the New DB and notify the user ( show an error message if trying to upgrade from New version to old db version )
    The idea is that you can do upgrade only from old to new version and not the opposite.

    Does anybody did something similar to this ?

    thanks in advance


  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Toronto, Canada
    63 Post(s)
    3 Thread(s)
    3. select version() as v | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Tampa, FL (US)
    1 Post(s)
    0 Thread(s)
    2. no, transactions in mysql do not support DDL statements. if you use a DDL statement in the query somewhere, it will commit your transaction before continuing.

    1. if you want a script, then you can write it in a script. and both sets of commands can be in the same script.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts