[Typo3] here's a script to convert phpbb users to typo3

Jay Austad austad at signal15.com
Thu Oct 20 23:50:02 CEST 2005


Script is below.  Could probably have some additional fields  
transferred over, but it works now.  You have to have CHC forum  
installed for this to work.  And you must make sure you delete  
EVERYTHING from your fe_users table first in order to keep the uid's  
consistent.  Also, the user/pass combo for both databases must NOT be  
the same.  PHP reuses connections with the same user/pass combo and  
it will fail.

If anyone wants to add to this or turn it into an extension, go  
ahead.  It connects to both databases and does the transfer on the  
fly.  No mucking around with sql dumps.

I didn't have time to whack this up myself, so I posted it to  
rentacoder.com and some girl from Azerbaijan whacked it up for me in  
like 30 mins.  Cost me $18.  :)

<?

error_reporting(E_ALL);

$username1="phpbbuser";
$password1="mypass";
$database1="phpbb";

$username2="root";
$password2="myotherpass";
$database2="typo3";

$db1 = mysql_connect("localhost",$username1,$password1);
mysql_select_db($database1, $db1);

$db2 = mysql_connect("localhost",$username2,$password2);
mysql_select_db($database2, $db2);

$res=mysql_query("select * from phpbb_users", $db1);
print mysql_error($db1);

$i=0;
while($rec=mysql_fetch_object($res)) {

   $uid               = $rec->user_id;
   $username          = mysql_escape_string($rec->username);
   $password          = mysql_escape_string($rec->user_password);
   $email             = mysql_escape_string($rec->user_email);
   $www               = mysql_escape_string($rec->user_website);
   $aim               = mysql_escape_string($rec->user_aim);
   $yahoo             = mysql_escape_string($rec->user_yim);
   $msn               = mysql_escape_string($rec->user_msnm);

   mysql_query("INSERT INTO fe_users  
(uid,username,password,email,usergroup,disable,starttime,endtime,www,tx_ 
chcforum_aim, tx_chcforum_yahoo, tx_chcforum_msn,status) ".
     "values ($uid,'$username','$password','$email', 
1,0,0,0,'$www','$aim','$yahoo','$msn',0)",$db2);
   $i++;
}

print "$i records inserted<br>\n";

?> 
   



More information about the TYPO3-english mailing list