Simple Machines Community Forum

SMF Support => Converting to SMF => YaBB/YaBB SE => Topic started by: Senkusha on April 23, 2004, 09:14:04 AM

Title: Add old yabbse 1.5 data ...
Post by: Senkusha on April 23, 2004, 09:14:04 AM
Hi, I've got an unusal problem.  When I first upgraded to SMF, I was forced to create a new database (for whatever reason the the upgrader didn't work), so I created a new database and directory structure with the clean install.  Now comes the problem.  After having my new SMF board up, I want to incorperate the old yabbse data in my SMF board.

Is there a way to do this? 

I have already tried to run some queries to insert the records from yabbse_messages, yabbse_topics, yabbse_boards (with updating the board id's to the new id's) and the yabbse_members (filtering out members that are already a part of SMF).  When I did this, My topics and messages were added, but nothing was syncronized (ie I would click on a website update topic and end up reading something completely different)  Keep in mind that the id's are auto_increment keys but I thoght I took care of that my updating the dependant keys by adding the number of id's to sync up.  I ended up with only a few messages being linked up correctly.

Please help if possible.  Thanks!
Title: Re: Add old yabbse 1.5 data ...
Post by: Oldiesmann on April 23, 2004, 10:54:33 AM
Why didn't the upgrade script work? What errors were you getting? That's the easiest way to convert old YaBB SE data to SMF...
Title: Re: Add old yabbse 1.5 data ...
Post by: Senkusha on April 23, 2004, 12:03:06 PM
Something about not being able to find the laungage files.  There were there, it just didn't work.  That's beside the point now, since I have over 150 messages in the new board.
Title: Re: Add old yabbse 1.5 data ...
Post by: Oldiesmann on April 23, 2004, 12:31:43 PM
Ok. Nevermind then. As far as updating stuff goes, it can be a real pain - I found that out when I decided to copy my data from a YaBB SE board to a fresh Enigma database (I was installing Enigma in a seperate place) and decided to re-sync all the member IDs while I was at it...

Anyway, here are some queries you can use.

Updating message ids:

UPDATE smf_messages SET ID_MSG='newid' WHERE ID_MSG='oldid'
UPDATE smf_attachments SET ID_MSG='newid' WHERE ID_MSG='oldid'
UPDATE smf_boards SET ID_LAST_MSG='newid' WHERE ID_LAST_MSG='oldid'
UPDATE smf_topics SET ID_FIRST_MSG='newid' WHERE ID_FIRST_MSG='oldid'
UPDATE smf_topics SET ID_LAST_MSG='newid' WHERE ID_LAST_MSG='oldid'


Updating board ids:

UPDATE smf_boards SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_calendar SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_log_boards SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_log_mark_read SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_log_notify SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_moderators SET ID_BOARD='newid' WHERE ID_BOARD='oldid'
UPDATE smf_topics SET ID_BOARD='newid' WHERE ID_BOARD='oldid'


That will move everything around and put things where you want them. Copy all your old data into a new SMF database like you did before, and then run those queries, and copy the data over to the current SMF tables, and you should be set.
Title: Re: Add old yabbse 1.5 data ...
Post by: Senkusha on April 23, 2004, 03:29:04 PM
I just thought of why what I did didn't work with simple math:

Say I have the following message ID's in my yabbse database:

3
4
5
7
8
13

That's all well and good, BUT when I INSERTed that data into my smf database those numbers added like this (assuming 130 was the last record in the table):
131
132
133
134
135
136

So when I did my math (yabbseID - 130) to change the message id's (as well as topic id's), they didn't match up!
yabbseID = smfID = neededID
3              = 131    = 133
4              = 132    = 134
5              = 133    = 135
7              = 134    = 137
8              = 135    = 138
13            = 136    = 143

So I guess I'll need some kind of script to compare the new data against the old data
Title: Re: Add old yabbse 1.5 data ...
Post by: Oldiesmann on April 23, 2004, 04:22:44 PM
Yeah. I'm not sure what you could do at this point, unless you would rather wipe out all the 100+ messages that are already there.