Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help integrate bbPress users and WordPress MU users

  • Hi!

    I have a forum running on bbPress and a WordPress MU, which I installed later. Both have users, some of them is present in both bases.

    So, we have two bases with some duplicate IDs and users. How can I integrate bbPress users into a WPMU database with less price?

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)

  • Hard Seat Sleeper
    Participant

    @hseatsleeper

    agl666 I’m no whiz but i would export both databases and merge them into an sql file, then dump back into your wpmu install. This will be a tricky operation, but unless someone else has a better idea I see no other way to do it.

    HSeatSleeper

    it’s a great idea but you miss something: there are a lot of duplicate IDs and users :)


    Hard Seat Sleeper
    Participant

    @hseatsleeper

    Yes, remove the duplicates.

    but duplicates, owing some content! for example, if ceronimo of WPMU (ID# 23) have comments in WPMU and ceronimo of bbPress (ID# 333) have topics in bbPress, what to do then?


    chrishajer
    Participant

    @chrishajer

    I think conceptually you’re going to need to renumber some members, and then change all the places where their old ID was being used, to the new ID.

    thanks, i had thoughts about it, but hoped that someone already had had that problem and solved ;)


    Hard Seat Sleeper
    Participant

    @hseatsleeper

    Yes sorry, I should have explained more.

    I just did something similar with a single install of wp.

    Keep in mind that when you use wp for user data, it will use all the ids in the wp_users table. When you click the option to use that db for user data, it doesn’t merge anything at all! So for example, if one user has an id of 5 in bbpress, when you use the wp db for user data whoever is 5 in that db suddenly gets the bbpress guy’s data.

    So! To get your data into shape, what you need to do is map the bbpress guys to the wp guys. So 5 in wp should be the same guy in bbpress. You might need to change the id of that user in the bbpress db.

    Also! there is a bbpress user metadata table, so be sure to change the id there, too.

    This is how I tackled it. There might be an easier way, or some tool, but if there is, I couldn’t find it. I just did some SQL on the db directly to get it structured as I needed it, then turned on integration.

    I’ve done like you explained.

    First, I’ve exported all IDs into Excel, then fill out new IDs (exactly bigger than can be in WPMU base – starting from 10000), then I searched for duplicate emails in wp_users and bb_users, exported to Excel and changed new_IDs of duplicated users to IDs_from_WPMU (something like that :).

    Then i’ve created array $old=>$new

    $change=array(
    1=>10001,2=>10002,3=>10003,5=>10004,7=>10005,8=>10006,10=>10007,11=>10008,12=>10009,13=>10010,14=>10011,15=>10012,16=>10013,17=>10014,18=>10015,19=>10016,20=>10017,21=>10018,22=>10019,23=>10020,24=>10021,25=>10022,26=>10023,27=>10024,28=>10025,29=>10026,30=>10027,31=>10028,32=>10029,33=>10030,34=>10031,35=>10032,36=>10033,37=>10034,38=>10035,39=>10036,40=>10037,41=>10038,43=>10039,44=>10040,46=>10041,47=>10042,48=>10043,49=>10044,50=>10045,51=>10046,52=>10047,53=>10048,54=>10049,55=>10050,56=>10051,57=>10052,58=>10053,59=>10054,60=>10055,61=>10056,62=>10057,63=>10058,64=>10059,65=>10060,66=>10061,67=>10062,68=>10063,69=>10064,70=>10065,71=>10066,72=>10067,73=>10068,74=>10069,75=>10070,76=>10071,77=>10072,78=>10073,82=>10074,83=>10075,86=>10076,89=>10077,92=>10078,94=>10079,95=>10080,97=>10081,99=>10082,100=>10083,101=>10084,102=>10085,103=>10086,105=>10087,106=>10088,107=>10089,109=>10090,110=>10091,111=>10092,113=>10093,114=>10094,115=>10095,116=>10096,117=>10097,118=>10098,119=>10099,121=>10100,122=>10101,123=>10102,124=>10103,125=>10104,126=>10105,667=>10106,669=>10107,670=>10108,671=>10109,672=>10110,673=>10111,675=>10112,676=>10113,678=>10114,679=>10115,680=>10116,681=>10117,682=>10118,683=>10119,684=>10120,685=>10121,686=>10122,687=>10123,688=>10124,689=>10125,690=>10126,691=>10127,692=>10128,693=>10129,695=>10130,696=>10131,697=>10132,698=>10133,699=>10134,700=>10135,701=>10136,702=>10137,703=>10138,704=>10139,705=>10140,706=>10141,707=>10142,708=>10143,710=>10144,711=>10145,712=>10146,713=>10147,715=>10148,716=>10149,717=>10150,718=>10151,719=>10152,720=>10153,721=>10154,722=>10155,723=>10156,724=>10157,726=>10158,727=>10159,728=>10160,729=>10161,730=>10162,731=>10163,732=>10164,733=>10165,734=>10166,735=>10167,736=>10168,739=>10169,740=>10170,741=>10171,742=>10172,743=>10173,744=>10174,745=>10175,746=>10176,747=>10177,748=>10178,750=>10179,751=>10180,752=>10181,753=>10182,755=>10183,756=>10184,759=>10185,761=>10186,762=>10187,763=>10188,767=>10189,769=>10190,771=>10191,772=>10192,773=>10193,774=>10194,775=>10195,776=>10196,777=>10197,779=>10198,780=>10199,794=>10200,795=>10201,796=>10202,797=>10203,798=>10204,799=>10205,801=>10206,803=>10207,810=>10208,811=>10209,815=>10210,837=>10211,842=>10212,847=>10213,848=>10214,857=>10215,861=>10216,871=>10217,872=>10218,880=>10219,905=>10220,926=>10221,936=>10222,937=>10223,943=>10224,944=>10225,955=>10226,961=>10227,962=>10228,964=>10229,965=>10230,967=>10231,968=>10232,969=>10233,972=>10234,973=>10235,974=>10236,976=>10237,977=>10238,978=>10239,979=>10240,980=>10241,981=>10242,982=>10243,983=>10244,985=>10245,987=>10246,988=>10247,993=>10248,994=>10249,996=>10250,997=>10251,998=>10252,999=>10253,1000=>10254,1001=>10255,1002=>10256,1003=>10257,1008=>10258,1011=>10259,1018=>10260,1019=>10261,1021=>10262,1024=>10263,1061=>10264,1062=>10265,1063=>10266,1064=>10267,1065=>10268,1073=>10269,1074=>10270,1076=>10271,1077=>10272,1078=>10273,1090=>10274,1091=>10275,1092=>10276,1093=>10277,1094=>10278,1096=>10279,1097=>10280,1098=>10281,1099=>10282,1101=>10283,1102=>10284,1103=>10285,1104=>10286,1128=>10287,1129=>10288,1130=>10289,1131=>10290,1132=>10291,1133=>10292,1135=>10293,1136=>10294,1137=>10295,1138=>10296,1139=>10297,1140=>10298,1143=>10299,1144=>10300,1145=>10301,1212=>10302,1408=>10303,1410=>10304,1412=>10305,1413=>10306,1415=>10307,1416=>10308,1417=>10309,1418=>10310,1419=>10311,1420=>10312,1421=>10313,1422=>10314,1423=>10315,1424=>10316,1425=>10317,1426=>10318,1427=>10319,1428=>10320,1429=>10321,1430=>10322,1431=>10323,1432=>10324,1433=>10325,1434=>10326,1435=>10327,1436=>10328,1437=>10329,1438=>10330,1439=>10331,1440=>10332,1441=>10333,1442=>10334,1443=>10335,1444=>10336,1445=>10337,1446=>10338,1447=>10339,1448=>10340,1449=>10341,1450=>10342,
    10001=>5,10002=>31,10050=>1095,10205=>22,10267=>23,10055=>2,10274=>40,10280=>32,10306=>15,10303=>1096,10314=>29,10322=>11,10327=>9,10325=>35,10341=>1092);

    echo "
    <pre>";
    foreach($change as $old=>$new){
    echo"
    UPDATE bb_users SET ID=$new WHERE ID=$old;
    UPDATE bb_usermeta SET user_id=$new WHERE user_id=$old;
    UPDATE bb_topics SET topic_poster=$new WHERE topic_poster=$old;
    UPDATE bb_topics SET topic_last_poster=$new WHERE topic_last_poster=$old;
    UPDATE bb_term_relationships SET user_id=$new WHERE user_id=$old;
    UPDATE bb_posts SET poster_id=$new WHERE poster_id =$old;
    ";

    }
    echo"</pre>
    ";

    This script returns SQL code changing old_IDs to new_IDs everywhere (or everywhere I could find) in bb_* tables.

    And, finally, export bb_users and import it to wp_users.

    Note!

    Use “Complete inserts” and REPLACE or UPDATE instead of INSERT, otherwise you will get 1) incomplete query (cause wp_users have 2-3 additional columns) 2)”duplicatу key” error

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar