On 29/12/06, Jan 2036@gmx.de wrote:
Is there any extension to merge user-accounts? Or could anyone give me the current (updated) SQL-Statements to merge to user-accounts?
To do all the base stuff:
UPDATE archive SET ar_user = $nid, ar_user_text = $nun WHERE ar_user = $oid UPDATE filearchive SET fa_user = $nid, fa_user_text = $nun WHERE fa_user = $oid UPDATE image SET img_user = $nid, img_user_text = $nun WHERE img_user = $oid UPDATE logging SET log_user = $nid WHERE log_user = $oid UPDATE oldimage SET oi_user = $nid, oi_user_text = $nun WHERE oi_user = $oid UPDATE recentchanges SET rc_user = $nid, rc_user_text = $nun WHERE rc_user = $oid UPDATE revision SET rev_user = $nid, rev_user_text = $nun WHERE rev_user = $oid
To move watchlist items too:
UPDATE watchlist SET wl_user = $nid WHERE wl_user = $oid
To move groups:
UPDATE user_groups SET ug_user = $nid WHERE ug_user = $oid
All the above assume that $nid is the user_id of the destination user, $nun is the user_name of the destination user, and $oid is the user_id of the user account which will not be used.
This will not delete the accounts; you could theoretically remove the corresponding user table row, and have the old user and talk pages redirect to the new ones (avoid breaking signatures on existing pages), but that's at your own risk.
As ever, when messing about with the database in a major fashion, make a backup.
Rob Church