UBB.Dev
Posted By: MattyJ Merge Users - 09/19/2006 1:56 AM
One of the most needed mods for me, is the ability to merge two user accounts, assigning one of them as primary, and deleting the second when the merge process is completed. At one time, there was a hack for this (a couple, actually), but it would be a great thing to get rolled into the 'core' code at some time.

Thanks!

Matt R.
Posted By: AllenAyres Re: Merge Users - 09/20/2006 12:25 AM
Yeah, would be nice in the core. I believe Ian is working on merge script, I've got the basic commands you can use in your control panel's mysql command box tho:


Update posts:
PHP Code

UPDATE ubbt_POSTS SET USER_ID
= '387' WHERE USER_ID = '9734'

UPDATE ubbt_TOPICS SET USER_ID = '387' WHERE USER_ID = '9734'

UPDATE ubbt_TOPICS SET TOPIC_LAST_POSTER_NAME = 'AllenAyres' WHERE TOPIC_LAST_POSTER_NAME = 'AllenAyres_dup1'

UPDATE ubbt_TOPICS SET TOPIC_LAST_POSTER_ID = '387' WHERE TOPIC_LAST_POSTER_ID = '9734'


Update Post count:
PHP Code

UPDATE ubbt_USER_PROFILE SET USER_TOTAL_POSTS
= '24080' WHERE USER_ID = "387"



Update PM's:
PHP Code

UPDATE ubbt_PRIVATE_MESSAGE_POSTS SET USER_ID
= '387' WHERE USER_ID = '9734'

UPDATE ubbt_PRIVATE_MESSAGE_TOPICS SET USER_ID = '387' WHERE USER_ID = '9734'

UPDATE ubbt_PRIVATE_MESSAGE_USERS SET USER_ID = '387' WHERE USER_ID = '9734'


If I am going backwards and using the _dup1 acct instead of the more recent acct, I'll use this to update the name after deleting the other acct:
PHP Code

UPDATE ubbt_USERS SET USER_LOGIN_NAME
= 'Scream' WHERE USER_ID = '8986'


I believe that covers it, if I've missed something, let me know smile
Posted By: MattyJ Re: Merge Users - 09/20/2006 3:06 PM
Thanks Allen!

I'll start cleaning up my site... the fun part, of course, is trying to track down all the duplicate accounts... but that's another story. smile

Posted By: Rick Re: Merge Users - 09/25/2006 10:49 PM
There will be a merge tool builtin for the final 7.0 release wink
Posted By: MattyJ Re: Merge Users - 09/25/2006 11:21 PM
Oh, you cannot imagine how that brightens my day!!! smile

Thank you!!!
Posted By: MattyJ Re: Merge Users - 10/03/2006 3:12 PM
FYI: I've been testing this on my site and it seems to be working with no issues! The key is identifying the account that the others need to be merged into. Then, transfer any profile values (manually) from the 'old' account into the new one, and when that's done, run the 'Merge User' function, which actually does the merge and blasts (deletes) the 'old' one.

What a time saver! Thanks Rick!
Posted By: Ian_W Re: Merge Users - 10/07/2006 12:20 PM
Originally Posted by Rick
There will be a merge tool builtin for the final 7.0 release wink


Did this make it to the final?
Posted By: Rick Re: Merge Users - 10/07/2006 5:58 PM
Yep. I had to merge like 300 users when I merged both forums on ubbcentral.
Posted By: Ian_W Re: Merge Users - 10/08/2006 2:14 PM
Thx - wasn't sure if you used a script or a built in part of threads.
© UBB.Developers