Upgraded forum, need help moving data to new field name

Discussion in 'MySQL' started by deepbluegxp, Sep 1, 2011.

  1. #1
    I'm not sure how to do this. I upgraded my forum from SMF1.14 to SMF 2.0

    The old database has a field called My Ride. I think the field id is CP3
    The new database has a field called cust_myride
    The databases have a unique member ID so I should be able to use that for the relationship

    I need to copy the data from the old database/old field to the new database/new field using the ID_MEMBER relationship. Please help. Thanks in advance.
     
    deepbluegxp, Sep 1, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Assuming MySQL, you could use phpMyAdmin to change the field names or you could dump the database to a text (.sql) file, change the field names and import the file, making sure you drop the table (in the file - that's the default) first.
     
    Rukbat, Sep 1, 2011 IP
  3. deepbluegxp

    deepbluegxp Active Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #3
    ok, I'll try that and get back to you. Thanks
     
    deepbluegxp, Sep 1, 2011 IP
  4. deepbluegxp

    deepbluegxp Active Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #4
    It's not separate fields so I can't drop one and rename the other.

    I found the old data still in the upgraded database in the same table called smf_themes. Each record has either the variable called cust_myride or cp3.

    The old viable is cp3 which isn't used any more and was assigned to members before the upgrade
    The new variable is cust_myride is assigned to the new members that have joined since the upgrade.

    How would I copy or rename the cp3 variable to the cust_myride variable.

    TIA
     
    deepbluegxp, Sep 11, 2011 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    In the .sql file is one way. It's a plain text file, so you can take dumps of the old and new databases, combine them, rename things, whatever you need to make it a working database. Then drop all the tables in the existing database and import the .sql file. (Keep unchanged versions of both dumps, so you can revert back if you need to.)
     
    Rukbat, Sep 11, 2011 IP