1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xf_user table import/export....

Discussion in 'General PHP and MySQL Discussions' started by Sheldon, Mar 6, 2012.

  1. Sheldon

    Sheldon Well-Known Member

    I have a question....

    I am trying to save a certain column in my table xf_user. Once I uninstall an add-on, it will be wiped and removed, then I am would like to install a newer version, and just bring back the old column information and over-write the newly installed column.

    Like this:

    ---sportsbook_cash (different user amounts contained, copy somehow)

    Delete Sportsbook add-on.

    Install new version

    then back to this again:
    ---sportsbook_cash (new version, all set at 0)

    Import just that column, overwriting the new sportsbook_cash information (all 0's) with the old sportsbook_cash information (misc amounts).

    I am sorry if I didn't explain that the best way, I am not the greatest with MySQL, still trying to learn (as you can see from the above). Is this even possible?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If the column is identical, why do you need to delete and recreate it?

    Why not just export the xf_user table, uninstall the add-on, install the new version, import the xf_user table.

    That should achieve what you want.
  3. Sheldon

    Sheldon Well-Known Member

    Yeah, I think though with the install, it will give an error because it will try to create the same table again.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Import the table after you install the new version of the add-on.

    Just drop the old table first.
  5. Sheldon

    Sheldon Well-Known Member

    Ok, how do I go about bringing in just that part, the sportsbook_cash part? I don't want to drop the entire xf_user table, then import it do I?

    I see what you are saying now.
  6. ARSamo

    ARSamo Member

    if the sequence of fields (columns) did not match with newer column.... is it still working after importing...?
  7. simbolo

    simbolo Well-Known Member

    Another way would be to alter the name of the column sportsbook_cash_old. Run the install. Remove the current sportsbook_cash column that is empty and rename the sportsbook_cash_old to sportsbook_cash.

Share This Page