News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Converting from IPB 2.3.1 to SMF - need to test first

Started by PaddyD, May 13, 2018, 12:23:44 PM

Previous topic - Next topic

PaddyD

HELP! Stuck again:
   
Converting...
Converting posts (this may take some time)...
Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll logs... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Successful.
Converting topic notifications... Successful.
Converting board notifications... Successful.
Converting moderators... Successful.
Converting permissions...Field 'description' doesn't have a default value

I've looked and the only two places "description" shows up in the sql script is in converting boards and smileys - and this is supposed to be in permissions. Can't find it. It's at step 1, substep 9. If I try to go to substep 10, it just complains again about the

The bit in the converting boards section is:

SUBSTRING(description, 1, 65534) AS description,

and the section in smileys is:

if (!empty($rows))
convert_insert('smileys', array('code', 'filename', 'description', 'smiley_order'), $rows, 'replace');


Meanwhile - all our members seem to be imported, and if you go into the statistics section of the board, you can see the topics that are supposed to be there, but clicking on anything gives you "Board structure corrupt: unable to find parent board" which isn't surprising considering we're not through the conversion yet.

vbgamer45

Check that smf_boards table the desciprtion has a default value set even if it is just "" JUST CAN't be null
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

So I looked and there are 12 boards (all imported from IPB) - one has no entry in the description field. Should I just put something in there?

vbgamer45

alter the database and allow null records and have default value for that column in smf boards table
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

You're assuming I know how to "allow null records and have default value for that column in smf boards table" - do I need to edit the conversion script? If so, how?

I'm assuming you're referring to this bit in "Converting Boards"? Right now it says:

SUBSTRING(description, 1, 65534) AS description,

I have altered the database - it only had the one empty description field in the moderators. That hasn't let me restart the conversion where I left off though.

vbgamer45

Try running this sql command on your SMF database

alter table smf_boards change description description varchar(255) null default '';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

I get an error when I do that. #1406 Data too long for column 'description' at row 1

Not sure what I'm to do with that...it IS a long description - should I shorten it and try again?

vbgamer45

Lets make it bigger
alter table smf_boards change description description varchar(2048) null default '';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

MySQL returned an empty result set (i.e. zero rows). I actually shortened the descriptions anyway - there were actually 2 it thought were too long with the previous command. And they were kind of wordy!! ;)

So - what next?

PaddyD

Now when I restarted - put it back a step to step 8, because it wouldn't do anything otherwise, I'm back to only 30,000 posts...where there were 140,000 before I did that (in SMF - there are over 200,000 in IPB) I'm not worried about losing a few, but this is getting silly.

PaddyD

So I restarted the conversion. And now we're right back at the same spot. I don't know if the conversion script needs editing or not.

Code for the board description bit (again):

SUBSTRING(description, 1, 65534) AS description,

Also found this thread: https://www.simplemachines.org/community/index.php?topic=422752.0 - so I've asked my host to disable MySQL Strict Mode temporarily, in case that works.

BTW - in the database the post count is back up to 132,000 in SMF - so we're missing some 77,000 from IPB. Topic count is 26,252 (SMF) vs 27,356 (IPB).

GigaWatt

Quote from: PaddyD on May 14, 2018, 07:13:19 PM
That and a whole boatload of others - I'm wondering if anyone wants my modified script when I'm done? LOL...

That would be appreciated. Others will surely benefit from it ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

PaddyD

So - my host cannot make changes to PMA on a shared server. (hadn't thought about that aspect of things - but makes sense)

So...I need to know how to make that script work, because it won't right now.

How do I edit

SUBSTRING(description, 1, 65534) AS description,

to make the "Converting members... 'Field 'description' doesn't have a default value" error go away and let me complete the conversion??

vbgamer45

I would take out SUBSTRING(description, 1, 65534) AS description,
And see if it converts and the description refer4ence in the .sql file
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

That's what I'm trying right now, actually. Will let you know if it works...

PaddyD

Well...I've now got a forum with almost all the topics, but the contents of all the posts are missing. EVERY single one I've checked so far. In the database, the messages are listed, but the message body is empty. :( I just ran it again, this time only running the convert posts section of the script, and it did the best job yet of importing everything - except the darned post body for each message. I'm missing about 1200 posts, but out of 209,802, I can live with that.

I need a merge script to merge the post from IPB with the empty "body" field in SMF, based on the post ID #. I'm not sure if I can figure out how to do that myself...I figure I know just enough to be dangerous in PMA. ;)

Signatures are screwed up (weird bits of HTML) but that is easily fixed.

vbgamer45

Does it look empty when you look in the body? in smf_messages?

You might be able to update statement to copy from existing db to the new db
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PaddyD

Quote from: vbgamer45 on May 15, 2018, 07:17:50 PM
Does it look empty when you look in the body? in smf_messages?

You might be able to update statement to copy from existing db to the new db

Oh yes, very empty indeed. If I could figure out how to copy from the existing db to the new one, I'd do it - but I'm afraid my database coding skills are minimal at best. Both the IPB and the SMF data is in one database - I installed SMF into the IPB db since that was mentioned in a few places as one way to do it, and I was certainly having a lot of trouble getting rolling. I was planning on dropping the IPB stuff once we were up and rolling. I did download the two posts tables into Excel to see what I could see in a slightly friendlier format - there are definitely post number anomalies somewhere - things missing in the SMF section (1200 posts in all).

Anyway - if someone can figure out how to write a script to copy the IPB post to the SMF body with the corresponding post ID, in PMA, I'll be grateful. I would imagine it's not difficult, but I get lost pretty quickly in trying to figure it out by reading online manuals.

GigaWatt

Have you tried with the SQL scripts posted on page 7 of the official support thread? Because some things differ from parts of the script you posted and the ones attached there.

SUBSTRING(description, 1, 65534) AS description, position AS board_order,

https://www.simplemachines.org/community/index.php?topic=238557.120
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

PaddyD

The problem is knowing which version is actually the most recent. ;) But the line you're showing is the same in both the version I used and the version you're referencing (I just didn't copy the last bit of it, since it wasn't the issue).

Anyway, the only thing I would like to still do is get the 200,000+ posts INTO the darned database - everything but the post itself is there. It's there in the IPB part of the database - so all I need is some bit of scripting that says "if post ID=x for both ipb_entry and sml_entry, then copy post content from ipb_entry to sml_entry." I don't know the correct syntax for that.

Advertisement: