Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Some user missed on importing from SMF
Avatar
Marco Rossi
Member
Free Members
sp_UserOfflineSmall Offline
Oct 21, 2012 - 11:29 am

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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 21, 2012 - 11:47 am

I wouldn't like to guess why one user went AWOL but was probably unable to resolve for some reason.
Yes - you should be able to do what you want to do in the way you describe.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Marco Rossi
Member
Free Members
sp_UserOfflineSmall Offline
Oct 21, 2012 - 12:40 pm

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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 22, 2012 - 5:59 am

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

andy-signature.png
YELLOW
SWORDFISH
Avatar
Marco Rossi
Member
Free Members
sp_UserOfflineSmall Offline
Oct 22, 2012 - 8:50 am

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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 22, 2012 - 11:38 am
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.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Marco Rossi
Member
Free Members
sp_UserOfflineSmall Offline
Oct 22, 2012 - 6:07 pm

Thanks a lot, Andy wink

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

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 22, 2012 - 9:14 pm

thanks for the kind words...  glad its resolved...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625