News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Merging user accounts??

Started by lilqhgal, March 10, 2006, 02:00:35 PM

Previous topic - Next topic

lilqhgal

I have a user who forgot her password and instead of requesting for a new one, just signed up with a new acct.  Is there some way to "merge" her two accounts so she can have her original one, with her correct profile info and all her posting stuff?  Thanks!
Just a lil' ole QH gal....

Kindred

yes, you can... but it si not for the faint of heart. It involved going into phpMyAdmin and writing some SQL set commands...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lilqhgal

Well, I'm game, if you don't mind giving me a step by step?
Just a lil' ole QH gal....

Dannii

Depends what exactly you want to do.

Choosing one profile and then moving all the posts of the other to the choosen one is easy.
Search for undelete member, as it's the same process.

If you want to merge Mambo stuff too then I don't know.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

lilqhgal

That's why I posted in the Mambo forum.  I'm using Mambo and have SMF bridged.  Running SMF1.1RC2 and using the 3.20 bridge.   Mambo version 4.5.2.3 (but plan to upgrade to Joomla soon).  This one particular user of my site "forgot" her password and instead of attempting to reset it, she just created a new user for herself.  Problem is, she was one of the biggest posters on the forum.  It's not much of a big deal to her, but I would love to be able to merge her posts and profile and stuff to her new account.  Because by this time, she's already got over 50 posts.  (Her old one had over 1700.)  So any help would be greatly appreciated!  I don't mind getting my hands dirty but I sure do need an instruction manual or something! LOL
Just a lil' ole QH gal....

Kindred

lil....    I will try to write up the SQL stuff for you on Monday
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lilqhgal

Kindred, you're my hero!  Thanks!  :)  Looking forward to it.
Just a lil' ole QH gal....

Kindred

Ok... so it's Tuesday...


In the code below, you will have to
replace NEWMEMBERID# with the new ID_MEMBER number from the smf_members table...
replace OLDMEMBERID# with the old ID_MEMBER number from the smf_members table...
replace NEWMEMBERNAME with the new memberName from the smf_members table...
replace OLDMEMBERNAME with the old memberName from the smf_members table...


UPDATE `smf_messages` SET `ID_MEMBER`=NEWMEMBERID# WHERE `ID_MEMBER`=OLDMEMBERID#;

UPDATE `smf_messages` SET `posterName`="NEWMEMBERNAME" WHERE `posterName`="OLDMEMBERNAME";


then look in the smf_members table...   
look at the number in the 'posts' column for the old memberID
look at the number in the 'posts' column for the new memberID
add the two together...

UPDATE `smf_members` SET `posts`=TOTALPOSTCOUNT WHERE ID_MEMBER=NEWMEMBERID#



If that doesn't make sense to you, let me know before you try it...   
and as always MAKE A BACKUP OF YOUR DATABASE FIRST!
this is mucking around in your actual database so mistakes can mess up your entire board...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lilqhgal

Thanks so much Kindred!  Okay so I have accomplished the above.  Let me make sure I know what I did (lol).  I basically took all the "old stuff" (profile info, posts, etc) from the old user account and "merged" it into her new user acct?  So I can theoretically delete the old one?  How about changing her NEW username back to her old username? (she went from something like Username to [email protected]).  Otherwise, so far so good!!!
Just a lil' ole QH gal....

lilqhgal

Hmm, it doesnt seem to have copied her old profile info to her new acct.  Following the above sql format, can I just update all the fields that are pertinant?
Just a lil' ole QH gal....

Kindred

yeah...  the bit that I gave you only copied the post count and assigned the old posts to her new account.   It did not copy any other profile information (sorry, didn't know you wanted the rest of it)

Yes, using that format, you can indeed copy/set anything and change her username/display name to match the old one...
(note: If you change her username, it will require her to log in with the changed name...)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: