Simple Machines Community Forum

SMF Support => Converting to SMF => phpBB => Topic started by: antracit on February 13, 2005, 10:45:19 AM

Title: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 13, 2005, 10:45:19 AM
Hello

I'm planning to change platform from scratch. I've succeeded to convert my board from Snitz (access, asp) to phpbb2 (2.0.11) and then to SMF (1.0.1, mySql, php).

Everything seems ok with one minor fault. I noticed that the topics are not sorted in the right order, more precisely; the replies will be on top. This becomes like "Jepardy": Answers first then in the end comes the question (topics). Everything else is ok.

Is there a way to fix this?


Thanks in advance
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: david1 on February 14, 2005, 09:38:30 AM
This isn't a bug. Go to you're profile, L&L preferences, untick, "Show most recent posts at top".  ;D
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: [Unknown] on February 14, 2005, 09:44:27 AM
The Snitz converter to phpBB is not very advanced, and does not properly convert topics in the right order.  I suggest you instead use the direct one to SMF, assuming you're using MySQL with Snitz.

Attached is a version I have, but I had to backport a few things and I don't have any way to test it, so be warned.

-[Unknown]
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 14, 2005, 01:31:46 PM
Thanks a lot. I will try both asap. I'm with access but can convert the tables to MySql.

Must say I like SMF a lot. Simple, fast and good looking 8)
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 14, 2005, 03:37:40 PM
Conversion stoped with this message?

Converting...
Converting messages... (this may take some time) successful.
Converting topics... Unsuccessful!
This query:
ALTER TABLE `antracit`.smf_topics
DROP INDEX firstMessage,
DROP INDEX lastMessage;
Caused the error:

Can't DROP 'firstMessage'. Check that column/key exists


This is what the adress field said
http://myserver/smf/snitz_to_smf.php?step=4&start=4000
So it came a long way. Members and so on. OK
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: [Unknown] on February 14, 2005, 04:26:44 PM
Hmm... looks like your topics table isn't set up totally correctly... can you run these queries?

DROP TABLE smf_topics;
CREATE TABLE smf_topics (
  ID_TOPIC mediumint(8) unsigned NOT NULL auto_increment,
  isSticky tinyint(4) NOT NULL default '0',
  ID_BOARD smallint(5) unsigned NOT NULL default '0',
  ID_FIRST_MSG int(10) unsigned NOT NULL default '0',
  ID_LAST_MSG int(10) unsigned NOT NULL default '0',
  ID_MEMBER_STARTED mediumint(8) unsigned NOT NULL default '0',
  ID_MEMBER_UPDATED mediumint(8) unsigned NOT NULL default '0',
  ID_POLL mediumint(8) unsigned NOT NULL default '0',
  numReplies int(11) NOT NULL default '0',
  numViews int(11) NOT NULL default '0',
  locked tinyint(4) NOT NULL default '0',
  PRIMARY KEY (ID_TOPIC),
  UNIQUE lastMessage (ID_LAST_MSG, ID_BOARD),
  UNIQUE firstMessage (ID_FIRST_MSG, ID_BOARD),
  UNIQUE poll (ID_POLL, ID_TOPIC),
  KEY isSticky (isSticky),
  KEY ID_BOARD (ID_BOARD)
) TYPE=MyISAM;

What is phpMyAdmin? (http://www.simplemachines.org/community/index.php?topic=21919.0)  This table structure should (hopefully) work.

-[Unknown]
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 14, 2005, 04:48:57 PM
Hi

:'(

phpMyAdmin said:

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned NOT NULL auto_increment,
  isSticky tinyint(4) NOT NU

(PHP Version 5.0.2, MySQL 4.0.21 on XAMPP)

Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: Grudge on February 14, 2005, 06:04:34 PM

DROP TABLE smf_topics;
CREATE TABLE smf_topics (
ID_TOPIC mediumint(8) unsigned NOT NULL auto_increment,
isSticky tinyint(4) NOT NULL default '0',
ID_BOARD smallint(5) unsigned NOT NULL default '0',
ID_FIRST_MSG int(10) unsigned NOT NULL default '0',
ID_LAST_MSG int(10) unsigned NOT NULL default '0',
ID_MEMBER_STARTED mediumint(8) unsigned NOT NULL default '0',
ID_MEMBER_UPDATED mediumint(8) unsigned NOT NULL default '0',
ID_POLL mediumint(8) unsigned NOT NULL default '0',
numReplies int(11) NOT NULL default '0',
numViews int(11) NOT NULL default '0',
locked tinyint(4) NOT NULL default '0',
PRIMARY KEY (ID_TOPIC),
UNIQUE lastMessage (ID_LAST_MSG, ID_BOARD),
UNIQUE firstMessage (ID_FIRST_MSG, ID_BOARD),
UNIQUE poll (ID_POLL, ID_TOPIC),
KEY isSticky (isSticky),
KEY ID_BOARD (ID_BOARD)
) TYPE=MyISAM;


Did you copy and paste the code from here? If so the smileys may have messed it up. Try the same thing again with what I've posted in code brackets.
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 15, 2005, 08:41:14 AM
Ok

Made a clean install with SMF 1.0.2. To get the propper tables. Started the script that made a lot of converting, members....and so on. Finaly it stoped with this....

Converting...
Converting topics... Unsuccessful!
This query:
INSERT INTO `antracit`.smf_topics
(ID_TOPIC, isSticky, ID_BOARD, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, numReplies, numViews, locked)
VALUES ('145', '0', '2', '142', '345', '4', '226', '0'),
('147', '0', '2', '158', '200', '2', '207', '0'),

and so on and so on

('648', '0', '47', '1364', '1779', '23', '708', '0');
Caused the error:

Duplicate entry '0-2' for key 2

Try again  :P


I meen this i very close now.. :)

[Unknown] would you need the Snitz converter to phpBB.

Thanks for the work you do!
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: [Unknown] on February 21, 2005, 03:27:23 AM
Alright, what if you try this:


DROP TABLE smf_topics;
CREATE TABLE smf_topics (
ID_TOPIC mediumint(8) unsigned NOT NULL auto_increment,
isSticky tinyint(4) NOT NULL default '0',
ID_BOARD smallint(5) unsigned NOT NULL default '0',
ID_FIRST_MSG int(10) unsigned NOT NULL default '0',
ID_LAST_MSG int(10) unsigned NOT NULL default '0',
ID_MEMBER_STARTED mediumint(8) unsigned NOT NULL default '0',
ID_MEMBER_UPDATED mediumint(8) unsigned NOT NULL default '0',
ID_POLL mediumint(8) unsigned NOT NULL default '0',
numReplies int(11) NOT NULL default '0',
numViews int(11) NOT NULL default '0',
locked tinyint(4) NOT NULL default '0',
PRIMARY KEY (ID_TOPIC),
UNIQUE poll (ID_POLL, ID_TOPIC),
KEY isSticky (isSticky),
KEY ID_BOARD (ID_BOARD)
) TYPE=MyISAM;


Does that help at all?

-[Unknown]
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: antracit on February 21, 2005, 02:17:45 PM
Hi

I made a new try. Good work and all topics got converted too. Stooped when counting personal messages. SQL said that there where no table by the name smf_ pm_recipients.
I commented out that like below.
// Get all members with wrong number of personal messages.
// $request = convert_query("
// SELECT mem.ID_MEMBER, COUNT(pmr.ID_PM) AS realNum, mem.instantMessages
// FROM {$to_prefix}members AS mem
// LEFT JOIN {$to_prefix}pm_recipients AS pmr ON (mem.ID_MEMBER = pmr.ID_MEMBER AND pmr.deleted = 0)
// GROUP BY mem.ID_MEMBER
// HAVING realNum != instantMessages");
// while ($row = mysql_fetch_assoc($request))
// convert_query("
// UPDATE {$to_prefix}members
// SET instantMessages = $row[realNum]
// WHERE ID_MEMBER = $row[ID_MEMBER]");
// mysql_free_result($request);

Strange about that? PM ? Should't that table be there by default?

After a new try it said OK...Perfect
When I look at my board everything was converted but the topics never shoved up. I did  a database cleanup in admin section and everything showed up!! Some Had been deleted when cleaning but that was some restricted boards. A do it again with no restricted boards and this will be (almost) perfect.  :D ;D

I can do with this since everything came in the right order to! 8)

Thanks a lot !!
Title: Re: phpbb2 to smf (topics came in wrong order)
Post by: [Unknown] on February 21, 2005, 02:24:50 PM
Oops, sorry again... that one I should have seen :(.

It's im_recipients in 1.0.

-[Unknown]