Jump to content

[SOLVED] Data Migration - Splitting into Blocks


tsilver10

Recommended Posts

I have a phpBB database which I am trying to convert to work with Joomla. I'm using a script someone has provided and it works fine...apart from one section - the message text.

 

It doesn't give me an error or anything so I can only assume it is timing out.

 

What I would like to do is split the query/migration of the message text into blocks.

 

Here is the what is doing at the moment:

 

//Populate Messages_Text Table
echo "<br />Populating Messages_Text Table...\n";

$query="TRUNCATE TABLE `$joomla_db`.`{$joomla_dbprefix}fb_messages_text`";
$result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error());

$query="SELECT post_id, post_text FROM `$phpbb_db`.`{$phpbb_dbprefix}posts`";
$result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error());  
$mtext = array();
$mpostid = array();
while ($row = mysql_fetch_object($result)) { 
  $text = addslashes($row->post_text);
  $mtext[] = prep($text);
  $mpostid[] = $row->post_id;
} 
mysql_free_result($result); 

for ($i=0; $i < count($mtext); $i++){
  $query="INSERT INTO `$joomla_db`.`{$joomla_dbprefix}fb_messages_text`"
    ." (mesid, message) VALUES"
    ." (".$mpostid[$i].", \"".$mtext[$i]."\")";
  $result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error());
}

echo "OK\n";

 

Does anyone have any tips for me to split this up?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.