Saturday night / Sunday was spent doing a total forum upgrade on KilkennyMusic.com, moving from phpBB2.0.22 (legacy) to phpBB3.
In doing the upgrade I needed to install a new copy of phpBB3, change a few URLs, download my phpBB2 database locally, convert it to the phpBB3 standard (due to timeouts on the server), upload the new database and everything was supposed to be grand.
I won’t claim to know everything about the ins and outs of phpBB’s database structure but I’d have a fair idea of where things go.
Flash forward an hour or so, the forum goes live once again, replying to old posts is no problem, some of the avatars missing (no big deal, only 3-4 of them site-wide) but new topics were posing a problem.
The posts were appearing, visible in their respective forums, times and authors correct, but clicking on them would tell you the topic didn’t exist. A quick search on Google revealed nothing so some time was spent digging through the database when I noticed the topic ID’s weren’t being set in either the X_topics or X_posts table (where X denotes your phpbb3 table prefix).
The cause of this, possibly happening during the conversion, was the topic_id field in X_topics not incrementing on posts. i.e. the field should be set to auto increment, thus solving the problem of their ID’s being set to 0.
If you’ve got access to phpMyAdmin, log into your database, select your X_topics table (by clicking on it’s name) and hit the ‘structure’ tab when your table loads. Edit the topic_id field (pencil icon in the row) and in the extras column, add the option to auto increment.
Presto, your posts start reappearing.
If you’ve made posts yourself (as I had done) you’ll need to set the topic IDs manually through the database as you can’t access the post from the forum in order to delete it. In setting the topic’s ID, browse your X_topics table and sort the order by topic_id (descending). Your faulty topic should have an ID of 0, so replace it’s 0 ID with the next number you see in the sequence. e.g. You sort your table by ID in descending order and see the sequence 3412, 3411, 3410. The number for your new (and presently faulty) post should be 3413.
The posts table was fine, the post IDs auto incrementing as they should have done, but the post wasn’t picking up the topic ID so you’ll have to enter the same topic ID into your X_posts table – that or delete the post, it’s up to you.
Having assigned the proper topic IDs in the database, the posts reappeared online while setting the topic_id field in X_topics to auto increment prevented the problem from raising it’s head again.
Confused? Or have you had better luck with your conversion?