How to use the textreparser after manual conversion to 3.2?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Mon Feb 20, 2017 6:17 pm

TLDR; I need help using the textreparse to update old forum posts to the 3.2 format.

I was running a very old phpbb 2 forum that was started in 2003 and has about 300k posts. I modded that phpbb 2 installation so heavily that any automatic upgrades became impossible. I changed dozens of files and also the structure of the database to add many custom functions.

So when phpbb 3 came around, I didn't upgrade. Until a few weeks ago my provider notified me that they are going to disable old php versions, meaning that my old forum will stop working in 2 days.

Now I had no choice and had to think how to migrate to a more modern forum software. I installed a fresh phpbb 3.2. Then I manually exported the relevant data from my old database, manipulated it accordingly and inserted it into the new database.

Mostly it worked well; all the users are still there and can log in as before, I migrated all the stats, the forums are working, all the threads and posts are there.

But the old posts look awful: All the images, links, bold/italic text and quotes are broken, because the forum does not interpret the BBcode, just shows everything as text.

Long story short, I replaced all the old posts text with how new posts look in the database, and although the old posts now look exactly like new posts when I read them directly in the database, in some magical way phpbb 3 still manages to not interpret the code in there. (I then restored a backup with the unchanged old posts.)

Then I read about how 3.2 stores posts text differently and that there is a class textreparser that can fix old posts.

I found this: https://area51.phpbb.com/docs/dev/32x/e ... t-reparser
But it does not really help me. It has been a while since I programmed in php and then it was still procedural. So I have little idea how to use classes. That 'explanation' above seems to go to great pains to NOT provide any usable example code. Like something that I can use to actually reparse the text of the posts in my database.

So how can I reparse the old posts to convert them into a working format for 3.2? I just need something that takes this one column, post_text in table phpbb3_posts, reparses it and writes the post_text into the DB in the correct format so that phpbb 3.2 shows them like they were in the old forum. Help is greatly appreciated.

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Mon Feb 20, 2017 6:44 pm

I guess the files in the original install folder would somehow use this reparser, because the new format was just introduced in 3.2. But when I re-upload the install folder, it does not let me do anything, just tells me to delete the install folder.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50412
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by stevemaury » Mon Feb 20, 2017 8:55 pm

Do you still have your old phpBB v 2.0.x database? Because there is a correct way to do this without all this manual stuff.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 9:48 am

Yes, but like I said, the structure is different because I modified it. Has lots of new columns and some new tables. I may also have modified existing ones, not sure. I did all this in 2004-2005.

Do you think it might work in spite of that? I was sure that the conversion will fail if the structure is not exactly as expected, so I didn't even try.

If so, considering that the new board is already running and users added new posts, would it be feasible to set up a third, new, empty phpbb 3.2 forum, migrate the old database to it using the official tools and then export the old posts from that new forum into the other new forum?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50412
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by stevemaury » Tue Feb 21, 2017 12:56 pm

IronCrown wrote:
Tue Feb 21, 2017 9:48 am
Yes, but like I said, the structure is different because I modified it. Has lots of new columns and some new tables. I may also have modified existing ones, not sure. I did all this in 2004-2005.

Do you think it might work in spite of that? I was sure that the conversion will fail if the structure is not exactly as expected, so I didn't even try.
Only one way to have known, but too late now.
IronCrown wrote:
Tue Feb 21, 2017 9:48 am
If so, considering that the new board is already running and users added new posts, would it be feasible to set up a third, new, empty phpbb 3.2 forum, migrate the old database to it using the official tools and then export the old posts from that new forum into the other new forum?
Not at all possible.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51696
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by Brf » Tue Feb 21, 2017 1:00 pm

IronCrown wrote:
Tue Feb 21, 2017 9:48 am
the structure is different because I modified it. Has lots of new columns and some new tables.
All of that is irrelevant. When you convert from phpBB-2 to phpBB-3 the old database will be left intact. The users, forums and topics will be copied out of the old database and inserted into the new one.

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 1:17 pm

Ok...

But how can it be that no manual importing of any kind is possible, and who would design such a thing? That does not make any sense. In the end it is nothing but text in a database. There must be a way to bring it into the correct form.

Any hint on how the phpbb 3.2 software even manages to not show my posts correctly if on the database level (which should be the lowest possible level) the stored text is exactly the same as a new post that is rendered correctly?

Does it have something to do with other fields like post_checksum?

User avatar
Theriddler1
Registered User
Posts: 448
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by Theriddler1 » Tue Feb 21, 2017 1:32 pm

You can reparse the bbcodes with the cli command

Code: Select all

php bin/phpbbcli.php --safe-mode reparser:reparse post_text --ansi
You can use the putty software for that or terminal, you need to have shell access to your site,
if not you can ask your host to enable it.

also i think it will be good to also update the database with this command:

Code: Select all

php bin/phpbbcli.php --safe-mode db:migrate
Theriddler - Moderator @ phpBB.nl | phpBBservice.nl Team-member
ImageSupport Tools | Image My Extensions | buy me a beer Image

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 1:47 pm

That looks like what I have been asking for, thanks.

On the other hand, if phpbb 3 can really just convert my old database, it will probably be the cleanest solution and might be worth losing a few days of new posts, so I'm going to try that now and set up a new forum. If that does not work, I will try with those commands.

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 3:04 pm

Well... I ran the conversion on a new board. It seemed to complete without issues. The new database was populated and looks like it should at first glance. But when I open the new forum in the browser, it just says "This Board is not available". It's not possible to log in, register or anything else.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51696
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by Brf » Tue Feb 21, 2017 3:10 pm

IronCrown wrote:
Tue Feb 21, 2017 3:04 pm
it just says "This Board is not available".
Remove the /install/ folder

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 3:19 pm

Did that, that's not it. The error message is also different if it's about that, and the ACP would still be accessible.

No, the board is just throwing some error obviously when trying to use the database.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51696
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by Brf » Tue Feb 21, 2017 3:30 pm

The only time phpBB should throw that error is if the /install/ folder was present, or if you have disabled it in the ACP. In that case, you should still be able to log in as your founder (userid #2).

IronCrown
Registered User
Posts: 16
Joined: Thu Oct 18, 2007 6:34 am

Re: How to use the textreparser after manual conversion to 3.2?

Post by IronCrown » Tue Feb 21, 2017 3:50 pm

The actual message is "Dieses Board ist leider momentan nicht verfügbar." because the board language is german. And it's an error message.

When I try to login and provide a wrong password, it actually tells me that my password was incorrect. Only when providing the right password, when the board then tries to show the forum page, the error occurs.

I wonder if character encodings are causing the problems here. Also with my manual conversion efforts. The old forum and database used the collation "latin1_swedish_ci" throughout, because that was for some reason the default on the server at the time of installation.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50412
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to use the textreparser after manual conversion to 3.2?

Post by stevemaury » Tue Feb 21, 2017 4:45 pm

IronCrown wrote:
Tue Feb 21, 2017 1:17 pm
But how can it be that no manual importing of any kind is possible, and who would design such a thing? That does not make any sense. In the end it is nothing but text in a database. There must be a way to bring it into the correct form.
There are about 7 or 8 other tables that would or could be affected if you attempted a partial import of posts from one database to another. Off the top of my head, the topics table, the users table, the attachments table, the bookmarks table, notifications table, posts table, poll_votes table, reports table, search_wordlist table, topics_posted table, topics_track table, and topics_watch table.

If you want to manually coordinate all the fields in all the relationships in all those tables, go ahead. I have never seen it done successfully.

The design of relational databases depends, by definition, on relationships between tables, and those cannot be ignored.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Post Reply

Return to “[3.2.x] Support Forum”