• 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....

Sheldon

Well-known member
#1
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:

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

Delete Sportsbook add-on.

Install new version

then back to this again:
xf_user
---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?
 

Brogan

XenForo moderator
Staff member
#2
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.
 

Sheldon

Well-known member
#3
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.

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

Brogan

XenForo moderator
Staff member
#4
Import the table after you install the new version of the add-on.

Just drop the old table first.
 

Sheldon

Well-known member
#5
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.
 

simbolo

Well-known member
#7
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.