Snitz to phpbb

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
Locked
TX-Rahman
Registered User
Posts: 2
Joined: Thu Jan 22, 2004 3:09 am

Post by TX-Rahman »

Ahhh ok... Isn't PHPNuke based on phpbb? If so...wouldn't the fields be the same for the users and messages?

Thanks :)
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

TX-Rahman wrote: Ahhh ok... Isn't PHPNuke based on phpbb? If so...wouldn't the fields be the same for the users and messages?


I think there are some differences... not too much probably :). Can you take a look?
User avatar
alpha10
Registered User
Posts: 3
Joined: Wed Jan 21, 2004 11:16 pm

Post by alpha10 »

Yeah, I did that - they contain the same info written the same way.

Can´t figure out the problem, if it´s not the script - I have installed many phpbb forums, and others too, both php and asp, so this is not my first time by any means doing stuff like this.

I have both snitz and phpbb runing on the same server with the same mysql database, so the settings should be quite easy.
RalucaM wrote: It's possible the server to be the problem. But if phpbb forum works on it, than my scripts should work too. Can you check the config.php file from the convertor to contain the same server settings as in config.php from phpbb forum?
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

alpha10 wrote: I have both snitz and phpbb runing on the same server with the same mysql database, so the settings should be quite easy.


I don't know why do you got that error. Send me the forum_forum table from your snitz database and I'll try to run on my server forums.php script.
Butterbean
Registered User
Posts: 2
Joined: Mon Jan 26, 2004 11:51 pm

Post by Butterbean »

I don't know how I missed this thread yesterday. I was in the same boat trying to import Snitz 3.4.03 "heavily modded." Below is what I came up with. Keep in mind I do not know much at all about PHP stuff but I did manage to populate the Nuke v7 users table. One issue, that I have no ideal how to fix is the $date1 is not converting the Snitz time format for me. My M_DATE strings in Snitz look like this 19990215200941 and is converting to and displayed as 919127381 This may be ok for phpBB but Nuke and phpBB port share the same user table so the field should contain Feb 15, 1999 .
Any help would be greatly appreciated,

I have since moved on to Topics and the topic dates look ok, but I have some issues with the script hanging with negative date. It seems back in 2000 when I converted from my old UBB forums that some of my dates years imported as -100 because of y2k issues. So I have to clean that up first.

Below is the lines I had to change.



$q = "INSERT INTO $phpbb_users VALUES (
'$row[MEMBER_ID]',
'$row[M_NAME]',
'$row[M_NAME]',
'$row[M_EMAIL]',
'',
'$row[M_HOMEPAGE]',
'gallery/blank.gif',
$date1,
'$row[M_ICQ]',
'$row[M_OCCUPATION]',
'$row[M_COUNTRY]',
'$hobbies',
'$sig',
0,
NULL,
'$row[M_AIM]',
'$row[M_YAHOO]',
'',
'$pass',
10,
'',
0,
0,
0,
'',
0,
'',
'',
4096,
0,
0,
$row[M_POSTS],
0,
0,
1,
1,
0,
$row[M_STATUS],
0,
0,
$date3,
10,
NULL,
'english',
'D M d,Y g:i a',
'0',
'0',
'0',
NULL,
'1',
'1',
'1',
'1',
'1',
'1',
'0',
'0',
'0',
'3',
NULL,
NULL,
NULL,
'0');";
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

Butterbean wrote: My M_DATE strings in Snitz look like this 19990215200941 and is converting to and displayed as 919127381 This may be ok for phpBB but Nuke and phpBB port share the same user table so the field should contain Feb 15, 1999 .


Just add after:

Code: Select all

$date1 = mktime($hour1, $min1, $sec1, $month1, $day1, $year1);
this line:

Code: Select all

$phpnuke_format = date("M d, Y", $date1);
In $phpnuke_format you will have the date in your format :).
Butterbean
Registered User
Posts: 2
Joined: Mon Jan 26, 2004 11:51 pm

Post by Butterbean »

Thank you so much, it worked like a charm. I went ahead and did my topics and Posts, but I had to add set_time_limit( 3600 ); to keep posts from timing out. I only have about 39,000 and it would only make it to 36k.
Now that it is working I need to go back to Snitz and unarchive a bunch posts and start over.

Thank you so much for all your efforts.. :D
Lex_
Registered User
Posts: 4
Joined: Mon Feb 02, 2004 9:37 am

Post by Lex_ »

First of all RalucaM thx for your scripts to convert the Snitz to phpBB, it worked without any problems.

I just have one "tiny" problem.....the posts, users everything was successfully transfered, but in all posts the http links to pics, pages are missing?

Dunno why? Why weren't the links in the posts transfered too?

greets Alex
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

Lex_ wrote: I just have one "tiny" problem.....the posts, users everything was successfully transfered, but in all posts the http links to pics, pages are missing?

Dunno why? Why weren't the links in the posts transfered too?


Because of some possible errors I strip all html tags from the posts:

Replace line 15 from topics.php:

Code: Select all

$message = strip_tags(str_replace("'", "\\'", $row[T_MESSAGE]));
with this one:

Code: Select all

$message = str_replace("'", "\\'", $row[T_MESSAGE]);
and line 57 from posts.php:

Code: Select all

$message = strip_tags(str_replace("'", "\\'", $row[R_MESSAGE]));
with this:

Code: Select all

$message = str_replace("'", "\\'", $row[R_MESSAGE]);
Tell me if it doesn't work.
Lex_
Registered User
Posts: 4
Joined: Mon Feb 02, 2004 9:37 am

Post by Lex_ »

I will try it....but not with INSER command cause i noticed this "bug" too late and the forum is already in use. I will have to try it with UPDATE command. Hopefully it will go well or my DB could be screwed up
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

I fixed the sorting of topics problem (because of the last post id field). The last version is now ver1.5: http://mraluca.go.ro/snitz2phpbb2.htm or http://ralucam.dap.ro/snitz2phpbb2.htm.
Last edited by RalucaM on Sun Mar 07, 2004 5:01 pm, edited 1 time in total.
notken
Registered User
Posts: 1
Joined: Wed Feb 11, 2004 3:05 pm
Location: London
Contact:

Tiny bug to watch out for, but otherwise fantastic

Post by notken »

RalucaM, your script was brilliant, thanks for that.

I did have a bug with it importing one particular message, though. One post was discussing escaping a single quote to avoid database problems, so it said

"searching for Steve's causes an error, so you have to search for Steve\'s instead"

Your import script does cause mySQL to fall over on this, because it changes this to:

"Steve\'s causes an error, so you have to search for Steve\\'s instead"

which means the backslash is escaped and the ' is left untouched. I think you might need to escape any backslashes, and maybe replace a single inverted comma with two as an alternative to the backslash, ie:
$message = str_replace("'", "''", $row[R_MESSAGE]);
$message = str_replace("\\", "\\\\", $message);
or some combination of this. I haven't tested this. I only thought about it after I edited the original post to get around the problem.

Cheers,
Steve
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

Yes, you're right with the backslash problem. I'll fix it... Thanx for notification ;).
wannab
Registered User
Posts: 2
Joined: Thu Feb 12, 2004 6:30 pm

Post by wannab »

RalucaM

First off I want to thank you for this converter and all of you time you sacrifice in order to help others. People like you make the world a better place!

I have a few questions that hopefully you can answer about the conversion:
  • Is there any issues if I want to use this converter on phpBB 2.0.4?
    On step 2 I am instructed to delete from phpbb_users all entries EXCEPT the first one (anonymous user). I look in that table and I see things such as user_id, user_active, username, user_password, and so on. Am I suppose to delete everything in this table execpt user_id?
Thx for help soo much for any help you can provide.

WB
User avatar
RalucaM
Registered User
Posts: 163
Joined: Thu Jan 24, 2002 1:42 am
Location: Romania
Contact:

Post by RalucaM »

wannab wrote: Is there any issues if I want to use this converter on phpBB 2.0.4?


Not at all. It should run perfectly on 2.0.4. But tell me if you got any errors.
On step 2 I am instructed to delete from phpbb_users all entries EXCEPT the first one (anonymous user). I look in that table and I see things such as user_id, user_active, username, user_password, and so on. Am I suppose to delete everything in this table execpt user_id?


user_id, user_active, username etc are the names of the fields from the phpbb_users table. You must not alter the structure of any phpbb table, so leave all that fields alone :). Instead, try to browse the phpbb_users table to see it's records. The first should be the Anonymous user. Leave it and delete all other users.
Locked

Return to “[2.0.x] Convertors”