News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Converter Requests?

Started by [Unknown], March 20, 2005, 02:04:41 AM

Previous topic - Next topic

dvd-man

Quote from: Oldiesmann on November 09, 2005, 11:03:33 AM
Try this sql file with the converter.php file found in the 1.1 Converters topic. I think I have it all figured out...

I'm stuck.. how do I run this file? It can't be run from the MySQL command line as it contains PHP code; yet it has SQL commands that aren't contained within mysql querys such as..


DELETE FROM {$to_prefix}membergroups
WHERE groupName LIKE 'phpBB %';

dvd-man

Well attempted to run convert.php anyway & got this error..


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Unsuccessful!
This query:
SELECT forum_id AS ID_CAT, forum_title AS name, forum_order AS catOrder
FROM `vcfdb0`.vcf_forums
WHERE forum_main = '0'
LIMIT 0, 500;
Caused the error:

Unknown column 'forum_title' in 'field list'

dvd-man

#102
Yep.. just confirmed the the field "forum_title" doesn't exist... however "forum_name" exists which is the name of each forum on the board. Additionally the "forum_main" field doesn't exist either. :(

Update: I had a look in the table "vcf_categories" of my phpBB2 board & it has the fields "cat_title" & "cat_main"..... r u supposed to be refererencing this table? :)

dvd-man

Sorry for all the posts... but just noticed that the field "forum_main" is referred to numerous times throughout the sql file.

Oldiesmann

forum_main is added by the categories heirarchy hack. I was going by the one at http://www.phpbbhacks.com/download/978. If you send me a copy of your database structure, I'll take a look and see what I can figure out.

dvd-man

Quote from: Oldiesmann on November 30, 2005, 12:11:55 PM
forum_main is added by the categories heirarchy hack. I was going by the one at http://www.phpbbhacks.com/download/978. If you send me a copy of your database structure, I'll take a look and see what I can figure out.


Ahh yes.. that's the newer version. I have the older version which is partly why I am moving to SMF as I don't want to rebuild my whole board as explained before.. :)

You can grab my table structure here.. www.videocardforum.com/current_table_structure.txt

Thanks for looking into it! :)

Oldiesmann

Ok. I'll modify the converter to work with that version.

dvd-man


Oldiesmann

Got one more question for you. What is the "cat_main_type" field used for?

dvd-man

Quote from: Oldiesmann on November 30, 2005, 12:45:37 PM
Got one more question for you. What is the "cat_main_type" field used for?

I have no idea.. all my cats have a setting of "NULL" in the database.

Oldiesmann

I was thinking it might be used to specify whether it's a category or a forum, but since it's not used, I'll just ignore it...

Oldiesmann

Thanks for your help with this. I finally figured it out (I think). Try this one and let me know what happens...

dvd-man

Quote from: Oldiesmann on November 30, 2005, 02:02:48 PM
Thanks for your help with this. I finally figured it out (I think). Try this one and let me know what happens...

Np.. glad to help! :D Ty for spending the time to create it! :)

dvd-man

Got past the categories but got stuck on the boards..


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Unsuccessful!
This query:
SELECT
f.forum_id AS ID_BOARD, f.forum_order AS boardOrder, f.forum_posts AS numPosts,
f.forum_last_post_id AS ID_LAST_MSG, f.forum_name AS name
f.forum_desc AS description, f.forum_topics AS numTopics, IF((f.main_type IS NULL) OR f.main_type = 'c', f.cat_id, fp.cat_id) AS ID_CAT,
IF(f.main_type = 'f', f.id_cat, f.id_forum) AS ID_PARENT,
CASE f.auth_read
WHEN 0 THEN '-1,0,2'
WHEN 1 THEN '0,2'
WHEN 3 THEN '2'
ELSE ''
END AS memberGroups
FROM `vcfdb0`.vcf_forums AS f, `vcfdb0`.vcf_forums AS fp
WHERE fp.forum_id = f.cat_id
AND f.main_type = 'f'
LIMIT 0, 500;
Caused the error:

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 'f.forum_desc AS description, f.forum_topics AS numTopics, IF((f.main_type IS NUL' at line 4

Oldiesmann

MySQL is too picky :P

Open up the file, and look for that "IF((f.main_type IS NULL)" part. Remove the parentheses around "f.main_type IS NULL".

dvd-man

No such luck... :(


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Unsuccessful!
This query:
SELECT
f.forum_id AS ID_BOARD, f.forum_order AS boardOrder, f.forum_posts AS numPosts,
f.forum_last_post_id AS ID_LAST_MSG, f.forum_name AS name
f.forum_desc AS description, f.forum_topics AS numTopics, IF(f.main_type IS NULL OR f.main_type = 'c', f.cat_id, fp.cat_id) AS ID_CAT,
IF(f.main_type = 'f', f.id_cat, f.id_forum) AS ID_PARENT,
CASE f.auth_read
WHEN 0 THEN '-1,0,2'
WHEN 1 THEN '0,2'
WHEN 3 THEN '2'
ELSE ''
END AS memberGroups
FROM `vcfdb0`.vcf_forums AS f, `vcfdb0`.vcf_forums AS fp
WHERE fp.forum_id = f.cat_id
AND f.main_type = 'f'
LIMIT 0, 500;
Caused the error:

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 'f.forum_desc AS description, f.forum_topics AS numTopics, IF(f.main_type IS NULL' at line 4



Compuart

add a comma after "f.forum_name AS name"
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Oldiesmann


dvd-man

Different error now..


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Unsuccessful!
This query:
SELECT
f.forum_id AS ID_BOARD, f.forum_order AS boardOrder, f.forum_posts AS numPosts,
f.forum_last_post_id AS ID_LAST_MSG, f.forum_name AS name,
f.forum_desc AS description, f.forum_topics AS numTopics, IF((f.main_type IS NULL) OR f.main_type = 'c', f.cat_id, fp.cat_id) AS ID_CAT,
IF(f.main_type = 'f', f.id_cat, f.id_forum) AS ID_PARENT,
CASE f.auth_read
WHEN 0 THEN '-1,0,2'
WHEN 1 THEN '0,2'
WHEN 3 THEN '2'
ELSE ''
END AS memberGroups
FROM `vcfdb0`.vcf_forums AS f, `vcfdb0`.vcf_forums AS fp
WHERE fp.forum_id = f.cat_id
AND f.main_type = 'f'
LIMIT 0, 500;
Caused the error:

Unknown column 'f.id_cat' in 'field list'

dvd-man

Well I changed this line from..


IF(f.main_type = 'f', f.id_cat, f.id_forum) AS ID_PARENT,


to..


IF(f.main_type = 'f', f.cat_id, f.forum_id) AS ID_PARENT,


..& it worked; however I looked in my "smf_boards" table & it only created records for my sub-forums & none of my other forums. :(

Additionally.. I got this error below after it processed the boards successfully; it now has an issue with the topics..


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Unsuccessful!
This query:
INSERT INTO `vcfdb0`.smf_topics
(ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
VALUES ('5', '0', '10', '116', '-1', '5', '6', '', '0', '7', '256'),
('6', '0', '12', '48839', '4', '310', '7', '', '0', '15', '443'),
('8', '0', '17', '62', '5', '5', '6', '', '0', '5', '198'),
('9', '0', '21', '24', '5', '5', '6', '', '0', '2', '96'),
('10', '0', '23', '882', '2', '5', '1', '', '0', '15', '635'),
('11', '0', '25', '260', '2', '-1', '3', '', '0', '3', '581'),

// Cut some out to make shorter

('513', '0', '3121', '3773', '45', '177', '5', '', '0', '18', '1650'),
('514', '0', '3139', '3142', '250', '243', '1', '', '0', '3', '40'),
('515', '0', '3170', '4465', '252', '243', '1', '', '0', '35', '920'),
('516', '0', '3196', '5016', '128', '243', '1', '', '0', '18', '1223'),
('517', '0', '3210', '3317', '245', '243', '1', '', '0', '12', '1233'),
('518', '0', '3212', '4565', '245', '177', '7', '', '0', '24', '794'),
('519', '0', '3256', '4949', '2', '243', '5', '', '0', '43', '1472'),
('520', '0', '3272', '3383', '252', '243', '1', '', '0', '5', '91'),
('521', '0', '3330', '4265', '233', '243', '5', '', '0', '31', '486'),
('522', '0', '3330', '3330', '233', '233', '1', '', '0', '0', '1'),
('523', '0', '3334', '4090', '128', '243', '18', '', '0', '27', '544'),
('524', '0', '3353', '3835', '245', '177', '1', '', '0', '11', '280'),
('525', '0', '3334', '3355', '128', '2', '1', '', '0', '2', '9'),
('526', '0', '3376', '3380', '256', '243', '1', '', '0', '1', '273'),
('527', '0', '3377', '6484', '177', '243', '4', '', '0', '38', '763'),
('528', '0', '3408', '22232', '257', '2', '1', '17', '0', '33', '1685'),
('529', '0', '3411', '15080', '177', '243', '2', '', '0', '37', '1549'),
('530', '0', '3456', '14795', '177', '243', '7', '', '0', '69', '1255');
Caused the error:

Duplicate entry '1415-1' for key 3

Advertisement: