Support Forum
Hi all,
not a big deal, but importing users from Simple Machine Forum, few users has not been imported, may be some conflict with names, I don't know and actually don't care too much because now it's too late to change.
The situation, now is that there are some thousands of posts that show correctly the username but as guest, because that user hasn't been imported.
I'm wondering if there is a way (a MySql query) to connect those posts to another or a new user account.
I have seen in db tables that those post don't have User ID number filled (of course, they results as guests) but show display name, so I wonder if should be possible to fill it (and may be some other field) to reassign to another user (i.e. the user sign up again with the same or another name and I assign him the new account ID to his previous posts, via phpMyAdmin).
Hope that this make sense.
Thanks in advance
Marco
Hakuna Matata
Hi Andy,
we emailed each other in August regarding importing from SMF in forum that has accented characters, do you remember?
I have seen that those user that has not been imported, have an accented letter in their profile, not in username but in real name, so may be...
You kindly fixed importing of posts with accented chars but may be this was hidden. Or may be there is another reason, impossible to investigate now and useless, too.
So, if that procedure is possible, as I'm not so skilled in MySql, may be, if and when you have time and want, could you kindly arrange a query for me? Would be greatly appreciated but of course this is something out of normal assistance, so I can only ask.
Or, at least, could you advice me which fields in which table have to change, to avoid mess?
Thanks in advance
Marco
Hakuna Matata
The first question is can you identify this users posts? You may be able to do this with the guest_name column. We need to know we are only going to operate on this single users records so can you look in the sfposts table to determine if this is possible? Another column that may be unique is the ip address...
YELLOW
SWORDFISH
|
Yes, the value that have to find out is name in guest_name, basically I need a routine that finds all guest_name that fits with a string (lets say "Joshua") and after fill the user_id field (unchecking null) or whatever else need, with another given string (the new ID number).
Is it possible?
Hakuna Matata
UPDATE wp_sfposts SET user_id = X, guest_name = '' WHERE guest_name='name';
Where X is the new User ID you want to assign and 'name' is the guest name you want to reassign to the new user ID.
Note also that I have set the table prefix to the default 'wp_' and yours may be different.
YELLOW
SWORDFISH
|
Thanks a lot, Andy
it worked well, I also modified this query to delete the guest_email and after worked on _sfposts I changed manually the post counter in users table, so now all posts seems correctly assigned to the right owner.
Really many thanks, guys, you are a great resource.
Marco
Hakuna Matata
thanks for the kind words... glad its resolved...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)