View Full Version : How to associate guest posts to a newly created user?
emdee
Tue 13th Jan '09, 10:53am
hi
i imported Community Server
I have some posts from a user who was deleted in the CS database.
how his posts how as "Guest" in VB( not clickable and no post count)
how do i associate all these Guest posts with a newly created username?
i ran the Fix Broken Profiles, it did not catch anthing
thanks
Jerry
Tue 13th Jan '09, 2:03pm
The posts will have a userid of 0 because of their user not existing when they were created.
Though as the name is there, we're in luck.
With the userid of the new user you can run this SQL :
"UPDATE post SET userid=X WHERE username LIKE 'Jerry'"
As with all direct database actions, take a database backup before you do this.
emdee
Tue 13th Jan '09, 3:17pm
Thanks Jerry for the reply.
I am a total newbie and a non-programmer , could you please elaborate:
where would i "run this sql" ? within VB admin control panel? or phpMyAdmin or somwhere?
lets say new username that i created in VB is Jack.
and i want imported posts that show Guest as username to go under Jack
is this how i code it?
"UPDATE post SET userid=Jack WHERE username LIKE 'Guest'"
Jerry
Tue 13th Jan '09, 3:29pm
You want all posts that show "Guest" as a username to go under the username and account Jack ?
emdee
Tue 13th Jan '09, 3:32pm
yes. (because i dont think any other users were allowed to post as Guest on the Community Server forum.)
Jerry
Tue 13th Jan '09, 3:36pm
If you have created Jack, find their userid by searching for them in your admincp, and seeing what it says at the top of the page.
Then run this SQL via the admincp or phpMyAdmin :
UPDATE post SET userid=X WHERE userid=0
And all guest posts will be associated with Jack, where Jack's userid is X.
Take a backup of your database before you do this.
emdee
Wed 14th Jan '09, 7:16pm
thanks Jerry that worked.
now i need to associate the Threads that do not show thread owner to a specific user.
is there an sql string i can run for this also?
Jerry
Wed 14th Jan '09, 8:24pm
UPDATE thread SET postusername='X', postuserid='Y' WHERE postuserid=0
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights