News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

PHPBB2 - problem with MySQL

Started by rejetto, August 22, 2006, 08:29:55 PM

Previous topic - Next topic

JayBachatero

They will be updated in the upcoming days.  They just need to be properly tested.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

mycroft

FWIW, I *did* finally get my database posted over; however, it DID require a bit of finagling.  (Many thanks to the ever-patient Oldiesmann)

I do not vouch for the following steps, but they did work for me in moving from phpBB to SMF:

1.  Ensure that copy_dir() is in the SQL file and convert.php. (otherwise there is a step where the copy_dir function is not found)
2.  Remove ALL indexes from smf_messages that contain ID_MSG. 
3.  Run convert.  It'll bomb at some point because of *duplicate* copy_dir functions (6 of one, half dozen of the other)
4.  Comment the copy_dir() in the SQL file out.
5.  Reload the page that bombed.
5a. You MAY have to drop the primary index on smf_board_perms as well (PRIMARY key has ID_GROUP, ID_BOARD, and permission.)
6.  Recreate all indexes that were dropped or modified.
7.  Forewarned is forearmed:  ALL the board perms come across as local, and while the phpBB usergroups/moderator groups *are* transferred, they need monkeying with to make work in the SMF environment.

So, bottom line is that it DOES work, but requires a bit of elbow grease.  All things considered, I much prefer this method to losing over 6K users and half a million posts!




Oldiesmann

Glad you got it all worked out. I'm still not sure why you were running into the problems with duplicate posts, etc., but at least you got it working :)
Michael Eshom
Christian Metal Fans

nathan42100

Sorry for bumping a semi-old topic but just to make sure, http://smf.person-lab.net/phpbb2_to_smf_2006_09_21.zip
The above link is the most recent and bug free version of the converter and fixes bugs such as the PM bug and the 1 letter sig chop off?

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

supersuineg

Quote from: nathan42100 on November 04, 2006, 06:09:44 PM
Sorry for bumping a semi-old topic but just to make sure, http://smf.person-lab.net/phpbb2_to_smf_2006_09_21.zip [nofollow]
The above link is the most recent and bug free version of the converter and fixes bugs such as the PM bug and the 1 letter sig chop off?

tried it i get this Converting smileys...
Fatal error: Call to undefined function: copy_dir() in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php(653) : eval()'d code on line 13

with the one i got from here yesterday i get this
Duplicate entry '14617' for key 1
the numbers change with each try. i have tried to rerun the whole converter 5 times and clicked the "try again" butten loads of times.  its the post data that is having the problum.
i must have this new forum running by tomarrow 12-06-06
is there anyway to bypass this or skip this one enrty or over wright it or tell the convert to just move on to the next qurry. is there away to do this one by hand . can i just mod the scrip to focus on just the post data ( tho i think the prob will still pop up) however it has to happen i will do it.
Thanks for your time http://www.simplemachines.org/community/index.php?topic=131974.0
these are my sites running SMF/Joomla
Muggles by day D69ers by night d69ers.com [nofollow]

God love you so much he sent his son to die for you. epworthunited.org [nofollow]

supersuineg

used the pach sql found on page 9 of this topic and now i get this (below) and not all the posts got moved as well as the forum won't let me login. Please i must have the smf forum up and running asap.

Notice: Undefined index: convert_script in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 571

Warning: Invalid argument supplied for foreach() in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 574

Notice: Undefined index: convert_script in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 579
Successful.
Recalculating forum statistics...
Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 921

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 931

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 939

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 949

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 962

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 975

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1021

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1023

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1029

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1035

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1046

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1047

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1055

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1057

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1063

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1064

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1070

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1071

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1095

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1097

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1103

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1115

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1140

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1142

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1178

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1179

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1217

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1222

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1283

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1285

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1321

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1340

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1372
Successful.
Conversion Complete
Congratulations, the conversion has completed sucessfully. If you have or had any problems with this converter, or need help using SMF, please feel free to look to us for support.
Please check this box to delete the converter right now for security reasons. (doesn't work on all servers.)

Now that everything is converted over, your SMF installation should have all the posts, boards, and members from the
Notice: Undefined index: name in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1448
installation.

We hope you had a smooth transition!

these are my sites running SMF/Joomla
Muggles by day D69ers by night d69ers.com [nofollow]

God love you so much he sent his son to die for you. epworthunited.org [nofollow]

jerm

Were you able to resolve this issue?

Benzin

Quote from: Oldiesmann on October 21, 2006, 04:04:17 PM
I'm not sure what's going on. I'd just suggest dropping the primary keys from the topics and posts tables (this will allow duplicate values in the ID column) and then adding them back when you're done:

ALTER TABLE smf_messages DROP PRIMARY KEY;
ALTER TABLE smf_topics DROP PRIMARY KEY;


Then when you're done:
ALTER TABLE smf_messages CHANGE ID_MSG ID_MSG int(10) unsigned not null auto_increment PRIMARY KEY;
ALTER TABLE smf_topics CHANGE ID_TOPIC ID_TOPIC mediumint(8) unsigned not null auto_increment PRIMARY KEY;


hmm  :'( i cant convert.. im stuck with this phpbb2 forum... dammit!!!

Benzin

Well ... FINALLY !  :D

I tried Tutsi´s tip

Quotehad the some problem, tried some fixes mentioned here on the forums but they all dont work. Until I found the workaround with the old converter, which worked for me.

1) Install 1.0.9
2) convert phpbb2 with old converter to smf 1.0.9
3) upgrade smf 1.0.9 to 1.1.1

So it seems the new converter still has issues the old one has no trouble at all with.

Anyway it worked so I am happy :-)

Good new year!

And.. IT WORKED! Thank you WERY much! and a Good new year!

prodigal

I had the same problem as Benzin and others , I fixed it by dropping smf_topics and recreating it with the following syntax


CREATE TABLE smf_topics(
ID_TOPIC mediumint( 8 ) unsigned NOT NULL AUTO_INCREMENT ,
isSticky tinyint( 4 ) NOT NULL default '0',
ID_BOARD smallint( 5 ) unsigned NOT NULL default '0',
ID_FIRST_MSG int( 10 ) unsigned NOT NULL default '0',
ID_LAST_MSG int( 10 ) unsigned NOT NULL default '0',
ID_MEMBER_STARTED mediumint( 8 ) unsigned NOT NULL default '0',
ID_MEMBER_UPDATED mediumint( 8 ) unsigned NOT NULL default '0',
ID_POLL mediumint( 8 ) unsigned NOT NULL default '0',
numReplies int( 10 ) unsigned NOT NULL default '0',
numViews int( 10 ) unsigned NOT NULL default '0',
locked tinyint( 4 ) NOT NULL default '0',
PRIMARY KEY ( ID_TOPIC )
);

Benzin

thank you prodigal ! that worked too :)

noaneo

Good evening,
I have a small problem with convert.php
I am SMF 1.0.7 et phpbb v2.0.22

Error message:
Quote
Which software are you using?
The converter did not find any conversion data files. Please check to see if the one you want is available for download at www.simplemachines.org. If it isn't, we may be able to write one for you - just ask us!
After you download it, simply upload it into the same folder as this convert.php file. If you're having any other problems with this converter, don't hesitate to look for help on our forum.

Try again

Warning: Unknown(): open(/mnt/133/sdb/9/c/noaneo/sessions/sess_034c162fa0a36f15042aa89f4fce91cf, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/133/sdb/9/c/noaneo/sessions) in Unknown on line 0

Why?

Thank you
Noaneo

prodigal

looks like you got either your path to phpbb or smf wrong

JayBachatero

No that means that the session.save_path is wrong or not writeable in php.ini.  What hosting company are you with?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

SillyCone

#175
Hello there,

I found some very interesting fixes in here, so I guess this would be a good place to propose mine...

I don't know about you, but I was very annoyed by the fact that the attachements were correctly copied over to SMF from phpBB2 attachment mod, but that the image didn't display in the posts... When I asked here in the community if it was possible, I was told : SMF Convert doesn't support thumbnails yet...

So I tried to hack the phpbb2_to_smf.sql to copy the attachment twice, resize the second copy, and insert it in the db with attachmentType set to 3... It worked, but nothing more was displayed. Damn, I hoped I didn't have anything to change elsewhere in the db, like the posts tables and so...
So I simply created a new post as a simple member, uploaded a picture, and it displayed as I wanted it to be. A quick look in the db showed that the only difference between my converted attachments and the native ones was... the width and the height columns in the smf_attachments table ! :)

So I changed the width and height of my attachments in the db, and voilà, everything was working perfectly !
I don't even need an actual thumbnail file nor a record in the attachments table, just setting the width and height of the pictures made my day.

I hope it's not breaking anything, not until now after a few tests, here is the code...

find this :

while ($row = mysql_fetch_assoc($result))
{
if (!file_exists($oldAttachmentDir . '/' . $row['encrypted']))
$row['encrypted'] = strtr($row['encrypted'], '& ', '__');

// Get the true filesize in case the old db lied!
$fileSize = filesize($oldAttachmentDir . '/' . $row['encrypted']);
if (!is_integer($fileSize))
continue;

// Frankly I don't care whether they want encrypted filenames - they're having it - too dangerous.
$newfilename = getAttachmentFilename($row['filename'], $ID_ATTACH);

if (strlen($newfilename) <= 255 && copy($oldAttachmentDir . '/' . $row['encrypted'], $attachmentUploadDir . '/' . $newfilename))
{
$attachments[] = "($ID_ATTACH, $fileSize, SUBSTRING('" . addslashes($row['filename']) . "', 1, 255), $row[ID_MSG], $row[downloads])";

$ID_ATTACH++;
}
}

if (!empty($attachments))
convert_query("
INSERT INTO {$to_prefix}attachments
(ID_ATTACH, size, filename, ID_MSG, downloads)
VALUES " . implode(', ', $attachments));


and replace with this :

while ($row = mysql_fetch_assoc($result))
{
if (!file_exists($oldAttachmentDir . '/' . $row['encrypted']))
$row['encrypted'] = strtr($row['encrypted'], '& ', '__');

// Get the true filesize in case the old db lied!
$fileSize = filesize($oldAttachmentDir . '/' . $row['encrypted']);
if (!is_integer($fileSize))
continue;

//SillyCone hack - 22/01/2007 - add the width and height of images, so they can be viewed in the post where attached !
//first get extension of file and test if it's a jpg, a gif or a png - add any other image type in here, sizeable by php
$attachextension = strtolower(substr($row['filename'],-4));
if (($attachextension != 'jpeg') && ($attachextension != '.jpg') && ($attachextension != '.gif') && ($attachextension != '.png')) {
$attachextension = '';
}

// Frankly I don't care whether they want encrypted filenames - they're having it - too dangerous.
$newfilename = getAttachmentFilename($row['filename'], $ID_ATTACH);

if (strlen($newfilename) <= 255 && copy($sourcefile, $attachmentUploadDir.'/'.$newfilename))
{
//SillyCone hack - 22/01/2007 - get size of the image to store in attachments table
$width = 0;
$height = 0;
if ($attachextension != '') {
$imagesizearray = getimagesize($oldAttachmentDir.'/'.$row['encrypted']);
if ($imagesizearray) {
$width = $imagesizearray[0];
$height = $imagesizearray[1];
}
}
//SillyCone hack - 22/01/2007 - added width and height to the VALUES string
$attachments[] = "($ID_ATTACH, $width, $height, $fileSize, SUBSTRING('".addslashes($row['filename'])."', 1, 255), $row[ID_MSG], $row[downloads])";
$ID_ATTACH++;
}
}

if (!empty($attachments))
//SillyCone hack - 22/01/2007 - added width and height to the query
convert_query("
INSERT INTO {$to_prefix}attachments
(ID_ATTACH, width, height, size, filename, ID_MSG, downloads)
VALUES " . implode(', ', $attachments));


Cheers,
SillyCone.

c64glen

I've used a combination of Oldiesmann and prodigal's fixes on this page to get the topics and messages across but now I get the Error Message;

..
Converting moderators... Successful.
Converting avatar gallery images...
Fatal error: Call to undefined function: copy_dir() in /usr/local/psa/home/vhosts/obscureinternet.com/httpdocs/forum3/convert.php(655) : eval()'d code on line 20

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Wizza

Im stuck on converting posts like mrcroft was..

I would do what he did but I have no idea on how to do it. If someone could explain and help me get all my posts converted I would be greatly appreciative.

Mr. Bean

Did you try using the converter that JayBachatero linked to?
Quote from: http://www.bash.org/?104052
<NES> lol
<NES> I download something from Napster
<NES> And the same guy I downloaded it from starts downloading it from me when I'm done
<NES> I message him and say "What are you doing? I just got that from you"
<NES> "getting my song back fker"

Advertisement: