need simple help writing a simple query for restoring 1 field from a backup

wtgw

Member
I have a xenforo forum with an old backup and current database, both xenforo. I wish to add the old "about" field into the current database's "about" field when user id is the same. Ideally, without repeating any text. So if the old about field says "hobby:woodwork and piano", and the new profile says "hobby:woodwork", I don't want it to say "hobby:woodwork and piano hooby:woodwork". I would like it to say "hobby:woodwork and piano".

I see the table xf_user_profile but I'm not sure how to write the query.

How would I do this?

Will this mess up anything with passwords?
 
You need to restore the old table with a different table name (preferable) or into another database (slightly more complicate for your query). Then you simply need to query the old table for the field and insert its value into the new table.
 
I have no idea how to do anything beyond pasting the query into phpmyadmin, could you provide an example for dummies? Yes I would back everything up before running it.

The "about" field is 1 column and when user ID is the same, I would like to add the about info but not add any duplicate words like in my first post. Any help? Thank you in advance.
 
As far as I'm aware you won't be able to selectively insert data based on what is already in the table. You'll most likely need a full script to do the back up that merges the two data points and sets them in the source database.
 
Top Bottom