Converter Release: Snitz Forums to PHPBB and PHPNuke

This is an archive of the phpBB 2.0.x convertors forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
vincentR
Registered User
Posts: 17
Joined: Wed Oct 22, 2003 11:46 am

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by vincentR »

Endeavour2 wrote: However later versions of Snitz use md5 hashes to store the passwords, which is the same as phpbb IIRC. .
do you know which versions? I looked for the info on snitz forum but could not find it...
vincentR
Registered User
Posts: 17
Joined: Wed Oct 22, 2003 11:46 am

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by vincentR »

Endeavour2 wrote:. So if you wanted you could add the bit of code to copy the passwords from Snitz to phpbb (very easy, just add 1 line of code to get the password from the Snitz database where the code extracts the username etc, then add the var to the insert statement that puts it into the phpbb database - it's all well commented).
Can you tell us which line to look?
Endeavour2
Registered User
Posts: 50
Joined: Wed Oct 18, 2006 3:47 pm

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by Endeavour2 »

vincentR wrote:do you know which versions? I looked for the info on snitz forum but could not find it...
No, sorry. I only found out because I spent some time analyzing the Snitz source code to make this converter. The best way to do this is try to dump the Snitz passwords directly into the PHPBB users table then log in. If you can log in, the Snitz passwords were using MD5 so you're in luck. If you can't, sorry.

As for dumping the passwords as part of the script, look for:

Code: Select all

$pass = md5($snitzuser["M_PASSWORD"]);
At around line 529 (sorry, my local dev version is different to the distro version). Change this line of code to:

Code: Select all

$pass = $snitzuser["M_PASSWORD"];
Then go to approx line 624 and make sure the SQL insert statement looks like this (you're specifically checking to make sure `user_password` and '$pass' are in the INSERT):

Code: Select all

			// Now sort the user out
			if($maptoexisting == False)
			{
				// This isn't being mapped to an existing user, so insert a new account to
				// the phpbb table
				$query = "INSERT INTO ".$phpbb_users."
							(        `user_id`,     `user_active`, `username`, `user_email`, `user_website`, `user_regdate`, `user_password`,  `user_attachsig`, `user_from`, `user_occ`,   `user_interests`, `user_sig`, `user_sig_bbcode_uid`, `user_posts`) VALUES 
							(  '$thisuser_phpbbid',      '1',      '$username', '$email',       '$web',       '$joindate',    '$pass',               '1',        '$country',   '$occupation',   '$hobbies',      '$sig',      '$bbcodeuid',      '$postcount')";
And that should be all you need to do. This change will directly dump the Snitz passwords into the PHPBB users table, so if they are MD5 hashes it will work directly.
User avatar
philwhite
Registered User
Posts: 122
Joined: Wed Aug 22, 2007 12:47 am
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by philwhite »

First, thanks for the converter. Just what I need.
Sadly, I get an error right at the start.

Code: Select all

Query was: INSERT INTO phpbb_users ( `user_id`, `user_active`, `username`, `user_email`, `user_website`, `user_regdate`, `user_password`, `user_interests`) values ( '3', '1', 'Snitz User', '[email protected]', 'http://www.amazingbrass.co.uk', 'Aug 22, 2007', 'c8a4c21d8773f1c0f87215f6ebf5d28f', 'This is a catch-all user for posts from deleted/invalid user accounts. It was created during the Snitz forum migration. This is not a real person!')

mysql_errno = 1264
mysql_error = Out of range value adjusted for column 'user_regdate' at row 1
extra info = Couldn't add the catch-all Snitz user into the phpbb user table
I can't see how the date can be out of range.
Clever ideas would be appreciated. I'm running MySQL 5.0.27 locally on a Windows machine with an Abyss Web server.
It's only words...
Wordwizard.com
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by D¡cky »

philwhite wrote:I can't see how the date can be out of range.
Clever ideas would be appreciated. I'm running MySQL 5.0.27 locally on a Windows machine with an Abyss Web server.
It is out of range because MySQL is expecting the date to be an integer, not a string. What needs to be done is convert the date to Unix time format which is a 10 digit integer.

OPEN Snitz2PHPBB.php
FIND

Code: Select all

$today = date("M")." ".date("d").", ".date("Y");
REPLACE WITH

Code: Select all

$today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
SAVE/CLOSE file
Have you hugged someone today?
User avatar
philwhite
Registered User
Posts: 122
Joined: Wed Aug 22, 2007 12:47 am
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by philwhite »

Thank you kindly.
I managed to get past that by creating the record manually with an integer date. The conversion then hung after 18 (slow) user records. Have to try it on my big workhorse machine. at the weekend.
It's only words...
Wordwizard.com
User avatar
philwhite
Registered User
Posts: 122
Joined: Wed Aug 22, 2007 12:47 am
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by philwhite »

Thank you so much. You have saved my bacon.

It took a long time with verification of the Snitz database, but I now have a 55,000-post phpBB forum.

There's only one minor issue that I've come across, namely that the URL BB code in Snitz requires quotation marks and phpBB doesn't.

Code: Select all

Snitz: [URL="www.xxx.com"]some text[/url].
phpBB: [URL=www.xxx.com]some text[/url].
That's soon rectified, but maybe you would want to include it.
It's only words...
Wordwizard.com
Endeavour2
Registered User
Posts: 50
Joined: Wed Oct 18, 2006 3:47 pm

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by Endeavour2 »

There's only one minor issue that I've come across, namely that the URL BB code in Snitz requires quotation marks and phpBB doesn't.
Yes, there are some curiosities with different versions of Snitz. I noticed that the versions of Snitz I've converted so far don't use the [ url="blah" ] syntax, they all use [ url ]blah [ /url]. That may possibly be because nobody has posted in the forum using that syntax, but never mind.

The function snitz2bbcode() handles all the bbcode'ing in the script, so make any changes you want in there.

Glad you got it working!


It might help others with expectations if you post the spec of your webserver and SQL server, and the rough time it took you to convert X users and 55,000 posts.
User avatar
philwhite
Registered User
Posts: 122
Joined: Wed Aug 22, 2007 12:47 am
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by philwhite »

I'm actually running into a lot more problems than I initially thought.

All the posts, users and replies went in okay. After a couple of false starts caused by posts longer than 60000 characters (should have turned off the "strict" option on the mySQL server before I started), the actual import took about 45 hours! About 3 hours for the users (2500), then a third of the rest for step 4, validating the Snitz database, and most of the rest for importing the posts. One reason it took so long is that I'm doing it on my laptop so that I don't interrupt it inadvertently (Centrino Duo 1.66 GHz, 1 GB RAM, Windows XP SP2, Abyss Web server, MySQL 5). In fact, watching the task manager, it's not particularly resource-intensive. It just takes time.

It looked wonderful in phpBB2 until I imported the resulting database to phpBB3. Most of the formatting appeared as HTML code (no longer supported in phpBB3)! I looked back at the original Snitz database and found that the vast majority of the codes are stored as HTML internally, even though HTML is and always has been deactivated on the board (URLs on the other hand are always stored as BBcode). Looking at the ASP of the pages, this seems to be deliberate. The codes are converted back from HTML when you edit or reply to a message with quotes. (I'm running Snitz 3.4.05 - the current release is 3.4.06.)

I can't see much point in making a completely fresh start to the site using phpBB2, so I'm stuck with solving this one!

The only way of getting a clean import that I see is to restore the BBCode in the original Snitz database and then run the converter.

I was thinking of trying to tap into Snitz's ASP routines that do the BBcode conversion, but they are not clean, particularly for nested quotes. At the moment, I'm messing about with regular expressions trying to capture everything, but for some reason, the UPDATE statement only seems to be being applied to random records. Still, that's my problem.

As far as the URLs are concerned, Snitz 3.4.05 only accepts them if they are quoted. Another problem with URLs is that they are accepted with or without the http://. But that's minor stuff compared with the frustration of the HTML code.

A quick addition you may consider is to apply the formatting alterations to the M_SIG field of the MEMBERS table so that the signatures are captured as well.
It's only words...
Wordwizard.com
User avatar
teainternet
Registered User
Posts: 2
Joined: Tue Oct 02, 2007 3:03 pm
Contact:

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by teainternet »

Hi

please
I'l appreciate any help to get to a solution

I try to convert mysql database snitz forum to phpbb(heb version)
[snitz 2 phpbb]Snitz Forums 2000 Version 3.4.05

I'v put the converter script files in a folder named "sz2phpbb" .
I try to run the converder after reading lots of posts in this forum.
I did changes as needed incloud the patch & backup.
it gave me 2 error note after run it.

Code: Select all

Notice: Use of undefined constant END_TRANSACTION - assumed 'END_TRANSACTION' in C:\Sites\MySite\Myhost\webroot\sz2phpbb\mysql.php on line 128

Code: Select all

MySQL query error!

Query was: INSERT INTO tphpbbh_users ( `user_id`, `user_active`, `username`, `user_email`, `user_website`, `user_regdate`, `user_password`, `user_interests`) values ( '3', '1', 'Snitz User', '[email protected]', 'http://www.amazingbrass.co.uk', 'Oct 02, 2007', 'c73ad2d41ced1e08da5170a124c418a6', 'This is a catch-all user for posts from deleted/invalid user accounts. It was created during the Snitz forum migration. This is not a real person!')

mysql_errno = 1364
mysql_error = Field 'user_session_time' doesn't have a default value
extra info = Couldn't add the catch-all Snitz user into the phpbb user table


Can someone understand from it what is there i'm doing wrong for getting this error message
Again I'l appreciate any help to get to the solution.

Joseph
User avatar
teainternet
Registered User
Posts: 2
Joined: Tue Oct 02, 2007 3:03 pm
Contact:

Re: Snitz Forums to PHPBB

Post by teainternet »

Eventually I manage to to do the converting.

But first i did as a must after backup all, was to copy all working tables with a differ prefix,
"test_forum_xxx" instead of "forum_xxx" and "test_phpbb_xxx" instead of "phpbb_xxx"
so in case of restore and retry, i had to restore only 16 tables, which saved a lot of time later on.
I pointed the snitz and phpbb config files to have the same prefix tables, so i can test them in a real working forum.
I change the converter script to the same prefix.
And copy all in a new test folder on the site.
However, I did run the script 5 times again and again till i fixed all the errors and restart the process with clean tables each time.

I no longer have a problem with this error:

Code: Select all

MySQL query error!

Query was: INSERT INTO tphpbbh_users ( `user_id`, `user_active`, `username`, `user_email`, `user_website`, `user_regdate`, `user_password`, `user_interests`) values ( '3', '1', 'Snitz User', '[email protected]', 'http://www.amazingbrass.co.uk', 'Oct 02, 2007', 'c73ad2d41ced1e08da5170a124c418a6', 'This is a catch-all user for posts from deleted/invalid user accounts. It was created during the Snitz forum migration. This is not a real person!')

mysql_errno = 1364
mysql_error = Field 'user_session_time' doesn't have a default value
extra info = Couldn't add the catch-all Snitz user into the phpbb user table
This error was fixed with the date string replaced as mentioned in earlier post i fail to notice before.

Code: Select all

	$today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
After this it gave me an Error when try to get last_post_topic_id = 0
He didn’t like forums with no posts, as it is the situation in the file download forum.
so i delete any forums that have other then posts (file download), or no posts at all, in another case.
eventually it did convert to phpbb tables.
I still have some issues unsolved,
like the bbcode didn’t get proper, and the password isn’t in md5, so just recover password is working.
And another problem to convert all data from latin1 chrset (in Hebrew) to utf8 chrset.
When I'll have more time later on I'll check for other problems.

I still have to convert every thing to phpbb rc5

Any additional help would be appreciated
So far ok.

Joseph
DewVinci
Registered User
Posts: 3
Joined: Sun Oct 21, 2007 4:19 am

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by DewVinci »

[message deleted by poster]
Shagz
Registered User
Posts: 1
Joined: Mon Oct 22, 2007 4:14 am

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by Shagz »

Just wanted to write in to express my thanks for writing this converter! Totally saved my bacon!

Only a couple of issues, nothing major though. My MySQL complained about line 487, the DEFAULT CHARSET designation. I think that's 'cuz I was using MySQL 4.x. Either way, removing that and things went fine. The other problem I had was the topics and replies import. Running in on the target server, I had to reduce the LOW_MEMORY_MAXTOPICS down to 5. Otherwise, the browser was timing out and not continuing with the import. Fortunately, I only had about 250 topics, so it didn't take very long.

Thanks again!
Emnitec
Registered User
Posts: 3
Joined: Thu Jan 03, 2008 2:48 pm

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by Emnitec »

Hello and happy new year to you all!

I'm trying to convert my Snitz 2000 (3.4.06) board to phpBB2 with the "amazingbrass" converter but It constantly stops in the same moment. I've searched here but yet not found the same problem.
Snitz info:
Snitz 2000 3.4.06
1370 members
11 forums
97161 posts
12558 topics
It start's fine and u can see it converting members but it always stops around memberID 460-500.. And when I try again I get this message:

Code: Select all

Confirmed the anonymous group was where it should be.
Confirmed the anonymous user was where it should be.
Found the last current phpbb userid (466), Snitz users will begin at 467.
Set the auto-increment to match the actual Nuke user id values.
Catch-all Snitz user already exists, guess you ran this script before :)
Deleting all phpbb users with a UserID higher than the Snitz catchall user.


MySQL query error!

Query was: SELECT `username` FROM phpbb_users WHERE `user_id`=466 LIMIT 1

mysql_errno = 0
mysql_error = 
extra info = Safety-check for the catch-all Snitz user failed - it didn't have the expected phpbb userid

I'll have the both applications locally on an XAMP-based dev-server with the latest XAMP release.

Anyone that have any clues??
Endeavour2
Registered User
Posts: 50
Joined: Wed Oct 18, 2006 3:47 pm

Re: Converter Release: Snitz Forums to PHPBB and PHPNuke

Post by Endeavour2 »

Please check your Snitz users table for id's around 450 to 500 (where you're getting the error) - are all the ids there and are they sequential, or is one missing (ie: does it go 460, 461, 462, 463 or does it go 460, 461, 463, 464 etc).

The error you posted is a symptom, not the cause. The error you're seeing is because the first conversion attempt failed and you tried to rerun the converter without wiping the phpbb users table - ie: you were doing it with already-converted Snitz users in the phpbb table.

The cause is a failure to convert a user in the range you described, so perhaps there is a faulty ID or a corrupt record. Manual checks should show something up, just scroll through each row of the Snitz database you converted to SQL and visually check them to make sure they look right.
Locked

Return to “[2.0.x] Convertors”