1
hightyde
How to insert old forum posts into newbb 2.0 database?
  • 2005/2/6 10:03

  • hightyde

  • Just popping in

  • Posts: 86

  • Since: 2003/7/11


My current newbb 2.0 database is missing about 7,000 posts, mostly old postsfrom 6-7 months ago. I have a backup of those posts, although they were in newbb 1.0 tables formats.

My question: How do I merge the data (old & new)? I want to insert into the new tables ONLY the threads/posts that were missing.

For example, one of the tables in question is xoops_bb_posts_text:

newbb 1.0 fields: post_id (unique), post_text;
newbb 2.0 fields: post_id (unique), post_text, edit_post;

Right now I have backup of newbb 1.0 records, full of statements like:

Quote:
INSERT INTO xoops_bb_posts_text (post_id, post_text) VALUES (10207,'My vote goes to Little Caeser. It's a great place for a pizza in Uptown.');


Since the missing posts are scattered throughout the whole record set manually finding/inserting those missing posts would take a whole day or two!

2
hightyde
Re: merge old forum posts
  • 2005/2/6 17:42

  • hightyde

  • Just popping in

  • Posts: 86

  • Since: 2003/7/11


Can I simply replace the MySQL INSERT statements with some kind of conditional statement like:

If post_id doesn't already exist, then INSERT INTO xoops_bb_posts_text (post_id, post_text) VALUES (10207,'My vote goes to Little Caeser. It's a great place for a pizza in Uptown.');

Right now if I just upload the backup file... the MySQL will insert the records until it runs into the next set of pre-existing records on the newbb2.0 data set. Then I would have to manually open up the backup newbb1.0 files, remove all the records sets that have been inserted so far, then try to upload again.

Then the MySQL will insert the records again until it runs into the next set of pre-existing records on the newbb2.0 data set... and I have to start to process again.

There's got to be an easier way than to do the inserts manually like this.

Please, anyone?

Login

Who's Online

348 user(s) are online (269 user(s) are browsing Support Forums)


Members: 0


Guests: 348


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits