miniBB Support Forums | 16 years on The Web
miniBB ® 


 | Begin | Register | Reply | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /   

inserting older posts by hand: topic_id, post_id and sorting problems

Author ike
#1 | Posted: 26 Feb 2004 14:13 | Edited by: ike 

I've prepared about 1500 topics (containg approx 25.000 posts) from an older forum to be inserted into an operating minibb forum. The userbase of the minibb forum already contains all the users of the older forum. The .sql files stand ready and are formatted according to the db shema described in _instal_mysql.sql. Except for two things:
1) the topic_id-s & the post_id-s, and
2) sorting: displaying existing topics BEFORE the inserted older ones.

1) As the new minibb forum already contains topics (about 200 topics, containing approx 2500 posts), the older topics and posts will need to be reindexed. The admin will freeze the new forum on the day of insertion, and pass me the first available topic_id and post_id. A sed script will then modify the .sql files rescpectively. For example, it there are 200 topics in the minibb forum, the first old topic will have topic_id of 201, the second 202 and so on..

Will such a scheme work? It should, from what I've seen in the db shema. I though of simply inserting the topics and posts without an id, so that the db would automatically assign it, but that would be too risky. The topics are in their own files, but the posts aren't (they're in the topic files). I would need to break the later one per file, sort them by post_id, and then insert them. Plus, each topic needs a last_post_id, bringing additional problems to the table.

2) The second problem is sorting. I wish to convince minibb that the older topics are indeed older and should thus be displayed BELLOW the new topics, despite of having a higher topic_id. Is there a way to do this? Or do I need to go to the unfortunate task of SQL UPDATEing the topic_id's of existing minibb topics to be placed BEHIND the inserted old topics? That would brake bookmarks and other references to existing minibb topics .. not good.

Of course, there is a test system to try the thing first. We wont alter the producting environment until things are well checked-out, and even then we'll prepare a backup beforehand.

Thanks for the answers,

Author Team
#2 | Posted: 26 Feb 2004 14:44 
Topics and posts in miniBB are sorted by their ID. By that, we mean that older topics contains smaller ID than newest (and that's true by incremental rules). So, probably, if both databases have the same ID on different topics and posts, there will be no simple way to convert them. Of course, you can write a script that calculates new IDs, based on posting dates, but it will be a difficult script.

Specific miniBB Support Forums / Specific /
 inserting older posts by hand: topic_id, post_id and sorting problems
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.


miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.