News:

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

Main Menu

[SMF Converter] Vanilla 2

Started by Nibogo, October 31, 2010, 01:01:12 PM

Previous topic - Next topic

Nibogo

Software: Vanilla.
Version: 2.0

Here's the converter from Vanilla 2.0 to SMF 2.0 RC3, this was tested under an small database so if you have any issues please report it here, data that will be converted:


       
  • Members
  • Categories
  • Topics
  • Boards
  • Posts
  • Avatars
  • Conversations (Personal Messages)

dkhobbs

Hi there, I am getting this error with the converter:

Converting members...Wrong value type sent to the database. Integer expected. (date_registered)

Any ideas?

Thanks!

Danielle

ThorstenE

in vanilla2_to_smf.sql find:
$row['date_registered'] = strtotime($row['date_registered']);
add after:
//no regdate? let's create one..
if(empty($row['date_registered']))
    $row['date_registered'] = mktime();

dkhobbs

Thanks for the help, that got me a little further - I needed to take similar steps for last_login and poster_email, but now I am stuck at:

Converting members... Successful.
Converting boards... Successful.
Converting topics...Duplicate entry '1293877524-4' for key 'last_message'

This is trying to import from the DateUpdated (datetime) field in the discussion table in Vanilla's db. 

ThorstenE

in vanilla2_to_smf.sql find
---* {$to_prefix}topics
---{

add after:
$ignore = true;

dkhobbs

So very close!  Here is the current error:
Converting members... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Successful.
Converting avatars... Successful.
Recalculating forum statistics... Duplicate key name 'ip_index'

It seems to have only imported one topic per forum as well?  And any topic with a single quote has been escaped with /// but that is easily fixable.

Thanks for all your help!

Danielle

dkhobbs

#6
I was able to rectify this error by changing if (!isset($indexes['ipIndex']))    to if (!isset($indexes['ip_index']))    per another message in this forum, and it says the conversion was successful, but it is still only showing 1 topic per board even though it shows the correct post count.  I am unable to access any if the other topics as I get the following error:

The topic or board you are looking for appears to be either missing or off limits to you.

dkhobbs

#7
Edited to say it's all good, the forum maintenance repair tools fixed the problems!  Happy dance!

antoniosacco

Hello i have this error...

Converting topics...The database value you're trying to insert does not exist: poster_name

Thanks in advance :d

gravesend46

Quote from: antoniosacco on March 21, 2011, 07:16:10 PM
Hello i have this error...

Converting topics...The database value you're trying to insert does not exist: poster_name

Thanks in advance :d


Hi, I've just got this message too while attempting this. Has anyone got an idea how to fix?

Oldiesmann

Do either of you have guest posts on your forum? It pulls the poster name from the "name" column of the User table based on the ID of the member who made the post.
Michael Eshom
Christian Metal Fans

gravesend46

I'm not sure. The forum was always set to registered members only as far as I recall, though it's not impossible there are guest posts I guess. Is there any easy way to check, I'm a bit of a MySQL/PHP novice.

Oldiesmann

Run this query in phpMyAdmin. If it returns any rows, then we'll have to tweak the query in the converter some to handle situations where there is no user associated with a particular post.

SELECT
t.DiscussionID AS id_topic, t.Announce AS is_sticky, t.CategoryID AS id_board, t.InsertUserID AS id_member_started, t.LastCommentUserID AS id_member_updated, t.body, t.CountComments AS num_replies, t.Closed AS locked, fm.name AS poster_name, fm.Email AS poster_email, t.DateInserted AS poster_time, t.name AS subject, fm.name AS modified_name, t.DateUpdated AS modified_time
FROM {$from_prefix}Discussion AS t
LEFT JOIN {$from_prefix}User AS fm ON (t.InsertUserID = fm.UserID)
WHERE fm.UserID IS NULL;


Replace "{$from_prefix}" with the prefix of your vanilla tables.
Michael Eshom
Christian Metal Fans

kevl

Hello,

I am getting this same error from thread:

http://www.simplemachines.org/community/index.php?topic=405111.0

Using this new converter.  I am stumped.

----------------------------------
Converting members...
Unsuccessful!
This query:

    SELECT
    m.UserID AS id_member, hxxp:m.name [nonactive] as member_name, m.DateFirstVisit AS date_registered,
    (m.CountDiscussions + m.CountComments) AS posts, m.DateLastActive AS last_login,
    CASE m.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,
    CONCAT_WS(' ', m.FirstName, m.LastName) AS real_name, hxxp:m.email [nonactive] AS email_address,
    CASE m.UtilizeEmail WHEN 1 THEN 0 ELSE 1 END as hide_email, m.Picture AS avatar,
    m.RemoteIp AS member_ip, m.RemoteIp AS member_ip2, '' AS password_salt,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS message_labels,
    '' AS personal_text, '' AS time_format, '' AS usertitle, '' AS secret_question,
    '' AS secret_answer, '' AS validation_code, '' AS additional_groups, '' AS smiley_set
    FROM `*****_vanilla`.GDN_User AS m
    LIMIT 0, 500;

Caused the error:

    Unknown column 'm.RoleID' in 'field list'
----------------------

kevl

OK got a little further -

Converting members... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts...Wrong value type sent to the database. Integer expected. (id_board)



Quote from: kevl on November 11, 2011, 05:35:53 PM
Hello,

I am getting this same error from thread:

http://www.simplemachines.org/community/index.php?topic=405111.0

Using this new converter.  I am stumped.

----------------------------------
Converting members...
Unsuccessful!
This query:

    SELECT
    m.UserID AS id_member, hxxp:m.name [nonactive] as member_name, m.DateFirstVisit AS date_registered,
    (m.CountDiscussions + m.CountComments) AS posts, m.DateLastActive AS last_login,
    CASE m.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,
    CONCAT_WS(' ', m.FirstName, m.LastName) AS real_name, hxxp:m.email [nonactive] AS email_address,
    CASE m.UtilizeEmail WHEN 1 THEN 0 ELSE 1 END as hide_email, m.Picture AS avatar,
    m.RemoteIp AS member_ip, m.RemoteIp AS member_ip2, '' AS password_salt,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS message_labels,
    '' AS personal_text, '' AS time_format, '' AS usertitle, '' AS secret_question,
    '' AS secret_answer, '' AS validation_code, '' AS additional_groups, '' AS smiley_set
    FROM `*****_vanilla`.GDN_User AS m
    LIMIT 0, 500;

Caused the error:

    Unknown column 'm.RoleID' in 'field list'
----------------------

kevl

Please?  Someone  :-X

Quote from: kevl on November 11, 2011, 08:43:31 PM
OK got a little further -

Converting members... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts...Wrong value type sent to the database. Integer expected. (id_board)



Quote from: kevl on November 11, 2011, 05:35:53 PM
Hello,

I am getting this same error from thread:

http://www.simplemachines.org/community/index.php?topic=405111.0

Using this new converter.  I am stumped.

----------------------------------
Converting members...
Unsuccessful!
This query:

    SELECT
    m.UserID AS id_member, hxxp:m.name [nonactive] as member_name, m.DateFirstVisit AS date_registered,
    (m.CountDiscussions + m.CountComments) AS posts, m.DateLastActive AS last_login,
    CASE m.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,
    CONCAT_WS(' ', m.FirstName, m.LastName) AS real_name, hxxp:m.email [nonactive] AS email_address,
    CASE m.UtilizeEmail WHEN 1 THEN 0 ELSE 1 END as hide_email, m.Picture AS avatar,
    m.RemoteIp AS member_ip, m.RemoteIp AS member_ip2, '' AS password_salt,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS message_labels,
    '' AS personal_text, '' AS time_format, '' AS usertitle, '' AS secret_question,
    '' AS secret_answer, '' AS validation_code, '' AS additional_groups, '' AS smiley_set
    FROM `*****_vanilla`.GDN_User AS m
    LIMIT 0, 500;

Caused the error:

    Unknown column 'm.RoleID' in 'field list'
----------------------

kevl

Really???  No one can help with this?  ???

Oldiesmann

For being such a simple system, Vanilla's codebase is extremely complex and confusing :o

It looks like they've moved users' role info to its own table, so try this...

In the vanilla_to_smf.sql file

Find
CASE m.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,

Replace
CASE mr.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,

Find
FROM {$from_prefix}User AS m;

Replace
FROM {$from_prefix}User AS m
LEFT JOIN {$from_prefix}UserRole AS mr ON (m.UserID = mr.UserID);
Michael Eshom
Christian Metal Fans

kjaonline

Hello I'm getting this error.
Notice: Use of undefined constant PATH_LOCAL_CACHE - assumed 'PATH_LOCAL_CACHE' in /home/kjalcord/public_html/tipidcdo.com/conf/config-defaults.php on line 26

madzilla

Just curious as to whether this will work on 2.0.17.3? I think the config files are in different locations.

Regardless, when I try to run it I get the open_basedir error despite Vanilla being in /forum and SMF being in /newforum.

Advertisement: