PDA

View Full Version : phpBB Import Lost Custom Post HTML



McCarron
Wed 31st May '06, 10:35am
Source - phpBB2 - 2.0.20
Target - vBulletin 3.5.4

I'm not sure why or how this happened, but after importing some posts using Impex from my phpBB board I lost a bunch of custom HTML that we used in one particular forum (2000+ posts here over the past 10 years). It appeared to convert the HTML to BBCode instead of leaving it as is. We pull these posts from the database to display on our front page as news updates, so we do styles on the images to move them to where we want them for a news post.

Is there an easy way to fix this and have Impex reload the data or do I have to manually feed one database to the other to move the raw post data over?

Thanks,
Patrick McCarron

Steve Machol
Wed 31st May '06, 4:29pm
Did you enable HTMl for those forums?

McCarron
Wed 31st May '06, 4:38pm
Yes I enabled HTML after the import, the forums were created on import by Impex. Didn't make a difference because all the HTML data was gone.

Steve Machol
Wed 31st May '06, 4:39pm
I suggest redoing the import and enabling HTML before the import.

McCarron
Wed 31st May '06, 4:51pm
I suggest redoing the import and enabling HTML before the import.

Is there a proper way to import only a certain forum from phpBB using Impex? Or to have it refresh the data in the posts it already migrated.

I don't want to lose any of the database structure changes on the new vB system which is already live and being used.

Steve Machol
Wed 31st May '06, 4:53pm
No sorry. You would need to redo the import.

What HTML is missing exactly?

McCarron
Wed 31st May '06, 5:10pm
No sorry. You would need to redo the import.

Do I have to reimport the users and everything else as well, basically start the vB forums over from scratch again? Or will it merge the user accounts as it imports them without over writing whatever they have in their vB account?



What HTML is missing exactly?

It turned all our HTML into bbcode. So IMG tags with style and class attributes were changed to BBcode without those extra attributes. Killed all the formatting for thosands of news posts.

Are you sure this wont happen to me again because I'd much rather code myself some php and sql to pull the proper data over into the post fields instead if I have to start everything over to find it didn't help me out any. Maybe you can point me to a person who worked on, or is more familiar with, Impex before I try this again.

Steve Machol
Wed 31st May '06, 5:16pm
Yes, what I menat was that there is no way to fix this and you would have to try the import again. Sorry if that wasn't clear.

As for whether or not it happens again, I cannot make any guarantees obviously. I'm just trying to provide options to test this out.

Jerry
Wed 31st May '06, 5:36pm
Is this a test import you are debugging or did you import straight and go live ?

ImpEx and the phpBB2 module strips as much of the HTML it can find be default and tries to match it to BB code.

McCarron
Wed 31st May '06, 6:32pm
Is this a test import you are debugging or did you import straight and go live ?

ImpEx and the phpBB2 module strips as much of the HTML it can find be default and tries to match it to BB code.

Unfortantely it looked okay from casually browsing the posts, and we put the forums live to keep the masses happy. I then later in the evening started to update our database pull scripts to pull from the new database. It wasn't until I was pulling that data that we saw the problem.

I could go back and do another import, that wouldn't be too difficult but if you say that it strips the HTML by default it wont get me anywhere.

Jerry
Wed 31st May '06, 7:42pm
If you want to bring over all the posts in raw format, i.e. what you had before you'll get now, I can tell you how to edit the file so ImpEx won't try to parse the content.

You'd have to be sure though as its could have any content !

McCarron
Thu 1st Jun '06, 12:44am
If you want to bring over all the posts in raw format, i.e. what you had before you'll get now, I can tell you how to edit the file so ImpEx won't try to parse the content.

You'd have to be sure though as its could have any content !

That would be great, anything to make it easier would be greatly appreciated.

Jerry
Thu 1st Jun '06, 4:45am
Ok, you'll have to edit the file :

impex/systems/phpBB2/009.php

Line 138 or thereabouts will be :



$try->set_value('nonmandatory', 'pagetext', $this->html_2_bb($this->phpbb_html($page_text['post_text'],$truncated_smilies)));


Change that to :



$try->set_value('nonmandatory', 'pagetext', $page_text['post_text']);


That will remove all the parsing so, what is in phpBB2 will go straight into vBulletin.

McCarron
Thu 1st Jun '06, 12:00pm
Actually I think I found some SQL that'll do this for me without having to run Impex again. Let me know what you think, I may have missed something I'll need but I think it should work.

Thanks to Impex using the imported postid from phpBB without changing it at all, so I can easily go over and pull from one database into the other.

This is just pseudo code, but you get the picture.


SELECT post.importpostid FROM thread,post WHERE thread.forumid = 9 AND thread.firstpostid = post.postid

FOR EACH importpostid

(old db)
SELECT post_text FROM phpbb_posts_text WHERE post_id = importpostid

(new db)
UPDATE post SET pagetext = 'post_text' WHERE importpostid = importpostid

Jerry
Thu 1st Jun '06, 4:09pm
In principle, that’s what ImpEx does, so should work yes.