Converting from YaBB2 RC3

Started by trepanne, September 26, 2008, 09:24:13 AM

Previous topic - Next topic

trepanne

Hi, I've got an old forum running YaBB2 RC3 that I'd like to try to upgrade to SMF.

I successfully installed SMF 1.1.6; browsing to index.php serves the right page.

However, I uploaded mf_1-1-6_yabb2_converter.tar.gz, untarred it, and browsed to convert.php... and nothing happened.  I get a blank white screen, no Apache errors, no program-generated errors, no form, no progress meters... nothin' but a blank white screen.

I realize there might be issues converting an RC version of old code, but I was surprised that I wasn't even given an opportunity to enter path/database information for the forum I wanted to convert.

Does this code work?

How best to proceed?

TIA!

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

Thanks for your help.

Ummm... I'm sure this is a dumb question, but... is there actually a convert.php file attached to that post?

SleePy

Oops, no there wasn't :P . Thats what I get for trying to do converter support during class :D

Try this topic
http://www.simplemachines.org/community/index.php?topic=140741.0
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

Thanks, man.  That popped up the form.

Using this version of convert.php along with the version of yabb2_to_smf.php from converters>download section of the website, the process crapped out thusly:
Converting membergroups... Successful.
Converting members... Successful.
Converting settings... Successful.
Converting personal messages... Successful.
Converting boards and categories... Unsuccessful!
This query:
INSERT INTO `forum`.boards
(name, description, countPosts, boardOrder, memberGroups, tempID, tempCatID, membergroups)
VALUES
...<snip>...
Caused the error:
Column 'memberGroups' specified twice

That's got to be a bug, no?

I'd appreciate anybody's help in how to proceed.  I'd really like to get this forum migrated to a SQL backend, and SMF looks like the way to go... but flushing the existing board content isn't an option.

TIA!

SleePy

Yes it was a bug. It was trying to use the membergroup column twice. I fixed it using a conditional statement to prevent this.
Try this one:
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

Chugging along...
The patch you provided appears to have gotten the boards done.  Now it's blowing up on the "mark read" table:
Converting membergroups... Successful.
Converting members... Successful.
Converting settings... Successful.
Converting personal messages... Successful.
Converting boards and categories... Successful.
Converting mark read data... Unsuccessful!
This query:
INSERT INTO `forum`.log_mark_read
(logTime, ID_MEMBER, ID_BOARD)
VALUES
...<snip>...
Caused the error:
Unknown column 'logTime' in 'field list'


Phew!  This seems like a job for an SVN repository.
Appreciate any help; my knowledge of PHP is zero.

SleePy

We have a svn repo, it just isn't public. Also some of these scripts are old and didn't get updated until after I took over converters (Jay didn't have much time to keep up on adding files/updating files to the repo). It is ok though. I am making the changes to my source files as we go through so that way it will get fixed next SMF release (and if I have committed the changes).

Open the yabb2_to_smf.php.
Find and remove this line:

                $row['logTime'] = $parts[1] != '' ? (int) $parts[1] : (int) trim($parts[2]);
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

OK, I patched yabb2_to_smf.php as indicated & it worked.
Now it's blowing up here:
Converting membergroups... Successful.
Converting members... Successful.
Converting settings... Successful.
Converting personal messages... Successful.
Converting boards and categories... Successful.
Converting mark read data... Successful.
Converting topics (part 1)... Successful.
Converting topics (part 2)... Successful.
Converting notifications... Successful.
Converting posts (part 1 - this may take some time)... Unsuccessful!
This query:
INSERT INTO `forum`.messages
(ID_TOPIC, ID_BOARD, subject, posterName, posterEmail, posterTime, icon, posterIP, body, smileysEnabled, modifiedTime, modifiedName, temp_filename)
VALUES
...<snip>...
Caused the error:
Duplicate entry '0-0' for key 1

Ummm... compound primary key?

The values being dumped pretty much all look like this:
('2', '4', 'Re: Topic', 'member', '[email protected]', '1134667302', 'xx', '255.255.255.255', 'Hello World', '1', '0', '', '')
Naturally ID_TOPIC and ID_BOARD are the same for each row.

Ummm... maybe the code isn't providing values for the key columns, so getting zero by default?

Thanks, I appreciate the help.

SleePy

Go into your database, view the smf_messages table. Click Structure. Down in the bottom left corner is a indexes table. What is the first index it shows?
Having a feeling that index wasn't dropped like it should of.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

I don't think i've got installed any PHP tools for DB admin, but i can ssh in.  This what you're after?
mysql> use forum
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show index from messages;
+----------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table    | Non_unique | Key_name      | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| messages |          0 | ID_MEMBER     |            1 | ID_MEMBER   | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          0 | ID_MEMBER     |            2 | ID_MSG      | A         |           1 |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | ipIndex       |            1 | posterIP    | A         |        NULL |       15 | NULL   |      | BTREE      |         |
| messages |          1 | ipIndex       |            2 | ID_TOPIC    | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | participation |            1 | ID_MEMBER   | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | participation |            2 | ID_TOPIC    | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | showPosts     |            1 | ID_MEMBER   | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | showPosts     |            2 | ID_BOARD    | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| messages |          1 | ID_TOPIC      |            1 | ID_TOPIC    | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
+----------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
9 rows in set (0.00 sec)

trepanne

Incidentally, I've been blowing away the DB & reinstalling SMF from scratch, so that's not likely the source of any problem re: indices not getting dropped.

SleePy

Yea that will do.
It looks like the indexes didn't get dropped like they should.

If you do it manually yourself by running the following does it drop the index?

ALTER TABLE messages
DROP INDEX ID_MEMBER;


Edit,
Although it appears the converter isn't dropping this index as well. So that most likely is our issue.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

I blew away the SMF installation, and its database.
I recreated the database, and reinstalled SMF.
On a clean install, I dropped the ID_MEMBER index from the messages table.
Then I performed the conversion using patched convert.php & yabb2_to_smf.php mentioned in this thread.

The conversion process proceeded further.  Now it dies here:
Converting posts (part 1 - this may take some time)... Successful.
Converting posts (part 2)... Unsuccessful!
This query:
ALTER TABLE `forum`.messages
CHANGE COLUMN ID_MSG ID_MSG int(10) unsigned NOT NULL auto_increment PRIMARY KEY;
Caused the error:
Multiple primary key defined

SleePy

Does the mysql user you are using have permission to alter tables and add/remove indexes?
It seems like a lot of the problems exist in the fact it can't drop or add the indexes.

If you can upgrade to Yabb 2.2, I did remake the yabb 2.2 converter to not drop or add indexes. I don't know how well it would work on a Yabb 2.0 install though.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

QuoteDoes the mysql user you are using have permission to alter tables and add/remove indexes?
Yes; I think the permissions aren't the problem here.

QuoteIf you can upgrade to Yabb 2.2, I did remake the yabb 2.2 converter to not drop or add indexes.
Maybe I'll try that, since this route isn't working terribly well.

Thanks for the help!

SleePy

Well let me know how this goes.

One reason I redid the Yabb 2.2 converter is I have noticed lots of alter issues where indexes and columns have not been changed correctly. So the new converter just adds a conversion table that it uses instead of altering stuff.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

trepanne

OK, thanks.  I've done the YaBB upgrade.  I'll start a separate thread here about my failure to convert the upgraded YaBB forum to SMF.

Advertisement: