News:

Join the Facebook Fan Page.

Main Menu

Snitz 3.4.03 to SMF

Started by NoRad, August 20, 2004, 01:35:27 AM

Previous topic - Next topic

[Unknown]

Sounds like you're going to need a resort... (they're not pretty, but they can be done...)

Try these two files.  Just put them in the smf directory and run them... and if they don't work, I guess you can always reconvert :/.  They were made way-back-when and haven't been tested lately :P.

-[Unknown]

NoRad

Any specific order in which to run them?

NoRad

The script appeared to resort the posts related to the topic, but now all of the topics are in the wrong forums with no apparent sorting.  :(

[Unknown]

Quote from: Radianation on August 20, 2004, 10:56:37 PM
The script appeared to resort the posts related to the topic, but now all of the topics are in the wrong forums with no apparent sorting.  :(

Hmm, that's worse isn't it :P?

Did you run both of them?  It should put them in order of post date, but they may or may not work with the current database structure totally well... I don't believe they do.  It was worth a shot :/.

-[Unknown]

NoRad

Yeah, it was worth a shot. I bet they could be modified though.   ;D

I re-ran them after I posted this and I ended up losing like 1/2 of my posts. I'll just reconvert and see if I can't fix it somewhere between the Snitz / Phpbb2 steps.

NoRad

Well, I think one of my first PHP projects is going to be writing  a converter for Snitz 3.4.03+ ->  SMF, assuming both are using mySQL. I'll let you know how the progress goes and submit it once I'm finished.

NoRad

#26
Hmmm... In the meantime, any quick fix for the ordering problem? This is what the Snitz -> PHPBB2 script says

Quote
The last problem
----------------

You will notice that the topics are not sorted in the right order, more
precisely, the topics with no replies will be on top. To fix this you
have to modify viewforum.php and replace this line:

ORDER BY t.topic_type DESC, t.topic_last_post_id DESC

with:

ORDER BY t.topic_type DESC, p2.post_time DESC

NoRad

#27
Somehow I need to re-sort all topics based on the most recent reply and topic post date. I don't appear to have dates set for the most recent replies when converting from snitz -> phpbb2 -> smf

Good news. The forum Maintenance fixed this problem. It found tons of errors on "bad first post" and fixed them, but now my replies are doing that weird thing again. The first post is last, but all the others are in order.  :-[


Here is an example of what I'm talking about:

http://www.thesilents.org/forum/index.php?topic=3493.0

Notice the last post *should* be the first one. It's like this on every thread AFAIK.

Grudge

#28
I have a suspecion that the repair_ID_TOPIC file I wrote may be dodgy... I'll try check it out today.

Also... I would recommend running the converter again and NOT running any of the repair files until I look over them.

EDIT: Or if you only ran the repair files ONCE just renamed old_topics table to topics...
I'm only a half geek really...

Grudge

Grrr... think I found the bug in the repair file already! Try this one attached instead. Remember you need to restore the old topics table FIRST!
I'm only a half geek really...

NoRad

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID_BOARD = 2' at line 3
File: C:\Inetpub\tsl\forum\repair_id_topic.php
Line: 131

Note: It appears that your database may require an upgrade. Your forum files are currently at version , whereas your database is at version SMF 1.0 RC1. It is recommended that you execute the latest version of upgrade.php.

I renamed smf_topic to smf_topic_broken and also renamed smf_topic_old to smf_topic

Now I get the above message...

Grudge

Do you have any boards that don't have any topics in them (i.e empty boards). If so that would explain the error. If not then I think we're in a little more trouble... If you do have any "empty" boards then running an error check will fix it.

If you don't, then I think you are unfortunatly going to have to run the converter from phpBB again (very sorry about this). I've tested the fixed repair_ID_TOPIC on my test board and it now seems to be OK so it shouldn't happen again hopefully...
I'm only a half geek really...

NoRad

Nope, empty boards. So is your file different than when I go through the forum_maintenance from the admin panel?

Grudge

Is that you "don't" have any empty boards?

The file I posted should be used instead of the one of the same name that Unknown had posted. It sorts the topics table by ID, but unlike the old one doesn't have a problem with it. Forum maintenance would only be needed if you had had an empty board - as the script error wouldn't have updated the boards table correctly...
I'm only a half geek really...

NoRad

Correct - I do not have any empty boards.

Your file might do what it's supposed to, but when I try to run it on my forum it seems to screw things up worse than they already are. Should I also run the message_ID fix with your new topic fix?

The forum maint fixes a lot of problems and creates new ones as well. It will find like 1,000 errors and "fix them"... Most of the errors say incorrect initial post (which sounds right), but then I think it gets confused on how to really fix it.

I sure wish I could write this converter directly from snitz to smf. I think I'm losing a lot of stuff in the phpbb2 conversion.

[Unknown]

I'm working on a direct converter, but it's pretty rough and I'm going to need you to test it.

-[Unknown]

[Unknown]

Okay, this is what I've got.  It should be as functional as the other converter, plus some.  You will still need to do "Recount all forum totals and statistics." and "Find and repair any errors." afterward, because it's not really 100% done, but it should get everything generally over.

It may or may not work... but it is a direct converter.  I can only guess at what needs to be done to the post text itself (probably a lot!) so bare with me.  And, I haven't been able to test it, so it may not even work at all.

Could you try this?  If you want to try it with a separate installation of SMF, and keep your current working, I'm happy with that... I just want to know if this is even working.

Thanks,
-[Unknown]

NoRad

That was way faster than I expected. I'll test it tonight. I am doing all of this on a side project at the moment, so it's not having an impact on my community. Thank you so much.

NoRad

First time through:
Quote
Converting...
Converting members... successful.
Converting categories... successful.
Converting boards...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Inetpub\tsl\smf\snitz_to_smf.php on line 478

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Inetpub\tsl\smf\snitz_to_smf.php on line 488
successful.
Converting messages... (this may take some time) incomplete.
Not quite done yet!
This conversion has paused to avoid overloading your server, and hence not working properly.
Don't worry though, nothing's wrong - simply click the continue button below to start the converter from where it left off.


After clicking continue:
QuoteConverting...
Converting messages... (this may take some time) successful.
Converting topics... successful.
Recalculating forum statistics... successful.


After checking my forums, it looks like there are no posts and no members (it says it can't find my member name). Upon closer inspection of the database I can see that smf_members has all of the users listed, but it only has the membername for the first user (admin) and not for any other others. I think it's important to point out that Snitz has two membername-like fields in the database. The one I think you might have called from is if you use NT Authentication (rarely used). The correct field to pull from would be M_NAME instead of M_USERNAME ... I'm making that change now.

The forum Maintenance found this:
Quote
The following errors are fouling up your forum (blank if none):

Topic 17 contains no messages
Topic 18 contains no messages
Topic 24 contains no messages
Topic 34 contains no messages

etc...

Topic 8 has a bad first message: 0
Topic 8 has a bad last message: 0
Topic 16 has a bad first message: 0
Topic 16 has a bad last message: 0
Topic 17 has a bad first message: 0
Topic 17 has a bad last message: 0
Topic 17 has a wrong number of replies: 0

etc...

Topic 1116 does not have a matching board (Board 2).
Topic 1264 does not have a matching board (Board 2).
Topic 1792 does not have a matching board (Board 2).
Topic 2065 does not have a matching board (Board 2).
Topic 2117 does not have a matching board (Board 2).
Topic 2158 does not have a matching board (Board 2).
Topic 2285 does not have a matching board (Board 2).
Topic 2313 does not have a matching board (Board 2).
Topic 2337 does not have a matching board (Board 2).
Topic 2338 does not have a matching board (Board 2).
Topic 2343 does not have a matching board (Board 2).
Topic 2347 does not have a matching board (Board 2).
Topic 2348 does not have a matching board (Board 2).
Topic 2356 does not have a matching board (Board 2).
Topic 2370 does not have a matching board (Board 2).
Topic 2372 does not have a matching board (Board 2).
Topic 2373 does not have a matching board (Board 2).
Topic 2379 does not have a matching board (Board 2).
Topic 2380 does not have a matching board (Board 2).
Topic 2381 does not have a matching board (Board 2).
Topic 2384 does not have a matching board (Board 2).
Topic 2386 does not have a matching board (Board 2).
Topic 2391 does not have a matching board (Board 2).
Topic 2396 does not have a matching board (Board 2).
Topic 2402 does not have a matching board (Board 2).
Topic 2413 does not have a matching board (Board 2).
Topic 2418 does not have a matching board (Board 2).
Topic 2421 does not have a matching board (Board 2).
Topic 2424 does not have a matching board (Board 2).
Topic 2437 does not have a matching board (Board 2).
Topic 2449 does not have a matching board (Board 2).
Topic 2456 does not have a matching board (Board 2).
Topic 2466 does not have a matching board (Board 2).
Topic 2471 does not have a matching board (Board 2).
Topic 2472 does not have a matching board (Board 2).
Topic 2477 does not have a matching board (Board 2).
Topic 2478 does not have a matching board (Board 2).
Topic 2482 does not have a matching board (Board 2).
Topic 2494 does not have a matching board (Board 2).
Topic 2497 does not have a matching board (Board 2).
Topic 2516 does not have a matching board (Board 2).
Topic 2521 does not have a matching board (Board 2).
Topic 2526 does not have a matching board (Board 2).
Topic 2530 does not have a matching board (Board 2).
Topic 2535 does not have a matching board (Board 2).
Topic 2537 does not have a matching board (Board 2).
Topic 2538 does not have a matching board (Board 2).

etc...


After that the results were:
Quote
130 topic(s) without messages have been removed successfully
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category
Successfully inserted salvaged messages in salvage category

All errors fixed! You will want to check on any created categories, boards, or topics to decide what to do with them.

Now I have 13 "Salvaged" boards. My original forum only had 12. It looks like one or more might also be empty now, but it shouldn't be that way.

NoRad

#39
A few more comments.

The topics don't list a "started by" (it's blank) - This is probably because of the M_NAME / M_USERNAME issue in the previous post.

Good news, the posts are in the correct order !!!


line 201:       'memberName' => 'M_USERNAME',
This should be M_NAME


line 207:      'realName' => 'M_USERNAME',
This should be M_FIRSTNAME + M_LASTNAME from Snitz.

Other fields of interest:
M_AVATAR_URL (if they have avatar mod) will be a URL (relative or absolute, depending on how they set it up. Mine is relative).
M_DOB and/or M_AGE (I use M_DOB. ie. 19780605 would be my bday).
M_SEX (male/female)
M_LEVEL (3 = admin, 2 = moderator, 1 = normal user)
M_QUOTE (this could = personal text)


// *** SMF column => other forum's column. ************************************
$members_table = array(
'ID_MEMBER' => 'MEMBER_ID',
'memberName' => 'M_NAME',
'dateRegistered' => 'UNIX_TIMESTAMP(M_DATE)',
'posts' => 'M_POSTS',
'ID_GROUP' => '',
'lngfile' => '',
'lastLogin' => 'UNIX_TIMESTAMP(M_LASTHEREDATE)',
'realName' => 'M_NAME',
'instantMessages' => '',
'unreadMessages' => '',
'im_ignore_list' => '',
'passwd' => 'M_PASSWORD',
'emailAddress' => 'M_EMAIL',
'personalText' => 'M_QUOTE',
'gender' => 'M_SEX',
'birthdate' => 'M_DOB',
'websiteTitle' => 'M_HOMEPAGE',
'websiteUrl' => 'M_HOMEPAGE',
'location' => 'M_COUNTRY',
'ICQ' => 'M_ICQ',
'AIM' => 'M_AIM',
'YIM' => 'M_YAHOO',
'MSN' => 'M_MSN',
'hideEmail' => '',
'showOnline' => '',
'timeFormat' => '',
'signature' => 'M_SIG',
'timeOffset' => '',
'avatar' => 'M_AVATAR_URL',
'im_email_notify' => '',
'karmaBad' => '',
'karmaGood' => '',
'usertitle' => '',
'notifyAnnouncements' => '',
'secretQuestion' => '',
'secretAnswer' => '',
'additionalGroups' => '',
);
// ****************************************************************************

Advertisement: