Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: Nibogo on October 31, 2010, 01:01:12 PM

Title: [SMF Converter] Vanilla 2
Post by: Nibogo on October 31, 2010, 01:01:12 PM
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:

Title: Re: [SMF Converter] Vanilla 2
Post by: dkhobbs on February 02, 2011, 08:32:07 PM
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
Title: Re: [SMF Converter] Vanilla 2
Post by: ThorstenE on February 03, 2011, 01:36:05 PM
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();
Title: Re: [SMF Converter] Vanilla 2
Post by: dkhobbs on February 03, 2011, 09:36:57 PM
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. 
Title: Re: [SMF Converter] Vanilla 2
Post by: ThorstenE on February 04, 2011, 01:29:48 AM
in vanilla2_to_smf.sql find
---* {$to_prefix}topics
---{

add after:
$ignore = true;
Title: Re: [SMF Converter] Vanilla 2
Post by: dkhobbs on February 04, 2011, 01:25:21 PM
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
Title: Re: [SMF Converter] Vanilla 2
Post by: dkhobbs on February 04, 2011, 04:53:04 PM
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.
Title: Re: [SMF Converter] Vanilla 2
Post by: dkhobbs on February 05, 2011, 12:25:02 AM
Edited to say it's all good, the forum maintenance repair tools fixed the problems!  Happy dance!
Title: Re: [SMF Converter] Vanilla 2
Post by: 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
Title: Re: [SMF Converter] Vanilla 2
Post by: gravesend46 on October 13, 2011, 05:50:47 PM
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?
Title: Re: [SMF Converter] Vanilla 2
Post by: Oldiesmann on October 14, 2011, 12:22:19 PM
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.
Title: Re: [SMF Converter] Vanilla 2
Post by: gravesend46 on October 14, 2011, 05:45:54 PM
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.
Title: Re: [SMF Converter] Vanilla 2
Post by: Oldiesmann on October 19, 2011, 11:34:45 AM
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.
Title: Re: [SMF Converter] Vanilla 2
Post by: 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, m.Name 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, m.Email 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'
----------------------
Title: Re: [SMF Converter] Vanilla 2
Post by: 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, m.Name 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, m.Email 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'
----------------------
Title: Re: [SMF Converter] Vanilla 2
Post by: kevl on November 12, 2011, 04:12:18 PM
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, m.Name 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, m.Email 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'
----------------------
Title: Re: [SMF Converter] Vanilla 2
Post by: kevl on November 16, 2011, 07:57:47 PM
Really???  No one can help with this?  ???
Title: Re: [SMF Converter] Vanilla 2
Post by: Oldiesmann on November 18, 2011, 11:28:23 AM
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);
Title: Re: [SMF Converter] Vanilla 2
Post by: kjaonline on December 25, 2011, 06:40:18 AM
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
Title: Re: [SMF Converter] Vanilla 2
Post by: madzilla on March 08, 2012, 12:17:10 PM
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.
Title: Re: [SMF Converter] Vanilla 2
Post by: zedole on March 12, 2012, 02:14:07 PM
Hello, i have problem with converter. When i have entered all, i click on Continue and i have a white page.
In this white page, if i refresh, i have :

Successful.
Recalculating forum statistics... can you help me please ?

Thanks you and sorry for my english ^^
Title: Re: [SMF Converter] Vanilla 2
Post by: aniraangel on April 07, 2012, 07:42:08 AM
Quote from: kjaonline on December 25, 2011, 06:40:18 AM
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

I'm getting this error as well.
Title: Re: [SMF Converter] Vanilla 2
Post by: zedole on April 11, 2012, 07:23:16 AM
Hello,

I have put in my FTP this files : convert.php and vanilla_to_smf.sql and when i put in Google Chrome : www.lapinscannibales.com/smf/convert.php i have an error 500. Please, can you help me ? Thank you :)
Title: Re: [SMF Converter] Vanilla 2
Post by: JoZ3 on June 27, 2012, 02:23:44 PM
Someone know the solution for this error


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


Vanilla forum version 2.0.18.4
Title: Re: [SMF Converter] Vanilla 2
Post by: neurofuzzy on July 23, 2012, 08:38:54 PM
I ran into this problem as well. You probably have orphaned comments - comments that have a DiscussionID that no longer matches a discussion.

You'll need to edit your Vanilla database to delete all comments that have a discussion id that no longer exists in the discussions table

Title: Re: [SMF Converter] Vanilla 2
Post by: bozhidarc on June 03, 2013, 08:41:54 AM
In 'vanilla2_to_smf.sql'

$rows[] = array(
   'id_first_msg' => $row['modified_time'],
   'id_last_msg' => $row['modified_time'],
);

The id for first and last message is set to the modified time. Why is that?
Title: Re: [SMF Converter] Vanilla 2
Post by: 1Chope on June 07, 2013, 10:27:17 PM
I am currently getting this error
Converting members... Successful.
Converting boards...Duplicate entry '1' for key 'PRIMARY'
I run this query DELETE FROM GDN_User WHERE UserID = 1;
but it doesn't solve the problem, anyone here got an idea?
Title: Re: [SMF Converter] Vanilla 2
Post by: piotao on June 26, 2013, 05:52:15 PM
Hello, me too have this problem:

Converting...
Converting members... Successful.
Converting boards...Duplicate entry '1' for key 'PRIMARY'


I've changed ID of GDN_User first record from 1 to 2, still the same error! Please HELP!

Vanilla: 2.0.18.4 (copied from production server after year of usage)
SMF: 2.0.4 (latest, empty, just installed)
apache2, linux os, etc. quite normal and working, php5, mysql5 of course.

I'm scratching my head. Please help!
Title: Re: [SMF Converter] Vanilla 2
Post by: piotao on June 26, 2013, 06:13:10 PM
I deleted the first and single entry from smf_boards table and it went to the end, failing on recalc. Anyway, all data seems to be in place, the only problem is I can't login to the forum now :)
Title: Re: [SMF Converter] Vanilla 2
Post by: piotao on July 03, 2013, 05:13:49 PM
Now I'm totally lost.

I've done the conversion and it went fine, the only problem was during reindexing at the end - duplicate key, etc. So, in another post I found an advice that renumbering forum will help. I did it, but some posts did not show.

I have all data in database, but topic with 102 replies is not showing up. This is the record from topics table:
id_topic    is_sticky    id_board    id_first_msg    id_last_msg    id_member_started    id_member_updated    id_poll    id_previous_board    id_previous_topic    num_replies    num_views    locked    unapproved_posts    approved
       230    0    1    1371109339    1371109339    65    65    0    0    0    102    3    0    0    1

and in messages table there there are 103 records with this topic_id. But in forum they DO NOT SHOW at all, and this is common for a lot of another topic. Please advice or help what to do. I have a direct access to the database by phpmyadmin and ssh shell. I can also run some programs on the server directly. HOW TO repair this? Maybe some dates are wrong?
Title: Re: [SMF Converter] Vanilla 2
Post by: Jovaan on August 24, 2013, 01:46:08 PM
Hello,

I've tried to convert from Vanilla2 to SMF, and i get this error message:

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

I've checked database, and that value "id_topic" exists, does any one knows what is happening?
Title: Re: [SMF Converter] Vanilla 2
Post by: Burke ♞ Knight on September 13, 2013, 09:53:17 PM
Is there a way to remove the converting of the members, and just do everything else?
I have run the converter once, and right after members, it locked up.
The member base is there, so would like to run rest without doing members again.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on September 14, 2013, 04:43:03 AM
It should be possible. The converters are run step-by-step so should be able to bypass one or several of them ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: MasterOne on November 14, 2014, 02:13:52 PM
Because that converter is not working for Vanilla 2.1.x, I have started a new thread for a Vanilla 2.1.x converter here (http://www.simplemachines.org/community/index.php?topic=530026.0). It's almost working, except the initial posting of every thread is missing. I'm not a coder and I don't really have a lot of insight here, so any help is highly appreciated.
Title: Re: [SMF Converter] Vanilla 2
Post by: Valeriane on November 18, 2014, 12:41:54 PM
Hi, i got this error => Notice: Use of undefined constant PATH_LOCAL_CACHE - assumed 'PATH_LOCAL_CACHE'
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on November 18, 2014, 01:39:17 PM
I don't find that constant in this convert.php...

NEvertheless, that's a notice, it shouldn't cause the converter to stop working...
Title: Re: [SMF Converter] Vanilla 2
Post by: Valeriane on November 18, 2014, 04:47:40 PM
ok I find out the solution according to you answers, thanks!
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 23, 2015, 06:12:19 AM
Hi guys,

I have a bluehost account and the auto installer has created two different sets of db for the vanilla forum and the SMF.

I am trying to migrate from Vanilla to SMF - how do I effect this transfer?

Please let me know.

Thanks,
Partha
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 23, 2015, 06:57:15 AM
We usually don't recommend to use auto installers because we don't know how they modify the default installation so some issues might arise.
In any case, having 2 databases is not a problem. You just need to make sure that SMF's MySQL user can access Vanilla's database to read the values. And that's it ;)
Converting to SMF (http://wiki.simplemachines.org/smf/Converting)
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 23, 2015, 07:09:25 AM
OK - so I sorted out the DB issue - but now I am stuck at this despite adding the code you suggested. What else do I need to do?

Quote from: ThorstenE on February 03, 2011, 01:36:05 PM
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();

Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 23, 2015, 07:11:37 AM
What is the error you get?
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 23, 2015, 11:30:28 AM
(https://www.dropbox.com/s/41b264w6oly1w79/Screenshot%202015-01-23%2020.26.35.png) (also attached)

Please help?

Quote from: margarett on January 23, 2015, 07:11:37 AM
What is the error you get?
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 23, 2015, 11:57:43 AM
Try this:
//no regdate? let's create one..
if(empty($row['date_registered']))
    $row['date_registered'] = time();


From http://php.net/manual/en/function.mktime.php
QuoteNote:

As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 23, 2015, 03:27:08 PM
This helped get past that and the same code got me past members too..

Now stuck on topic...

Converting members... Successful.
Converting boards... Successful.
Converting topics...The database value you're trying to insert does not exist: id_topic
- this happens if I use
---* {$to_prefix}topics
---{
$IGNORE = true;


and I get this:
Converting members... Successful.
Converting boards... Successful.
Converting topics...Duplicate entry '0-4' for key 'last_message'
if I use
---* {$to_prefix}topics
---{
$no_add= true;


Quote from: margarett on January 23, 2015, 11:57:43 AM
Try this:
//no regdate? let's create one..
if(empty($row['date_registered']))
    $row['date_registered'] = time();


From http://php.net/manual/en/function.mktime.php
QuoteNote:

As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 25, 2015, 07:11:02 PM
You shouldn't add "no_add". Only specific actions of the converter should use that and "topics" isn't usually one of them...

Also, try with $ignore instead of $IGNORE
They are different.
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 25, 2015, 09:49:48 PM
tried with $ignore - still no go... same error as $IGNORE

Quote from: margarett on January 25, 2015, 07:11:02 PM
You shouldn't add "no_add". Only specific actions of the converter should use that and "topics" isn't usually one of them...

Also, try with $ignore instead of $IGNORE
They are different.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 26, 2015, 04:56:05 AM
Are you using the converter from the first post in this topic or the one from the downloads section of the site?
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 26, 2015, 06:45:31 AM
I am using the converter from the start of this thread... The one from the "downloads" section doesn't even work to start with.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 26, 2015, 06:49:55 AM
OK, just so that I know ;)

So in this case you MUST use $no_add (sorry for the wrong information before).

So, if you have $no_add you get a duplicate entry error, is it correct? Can you try with both $no_add and $ignore?
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 26, 2015, 07:07:51 AM
how would I do that? two lines of code? or both in the same?

Quote from: margarett on January 26, 2015, 06:49:55 AM
OK, just so that I know ;)

So in this case you MUST use $no_add (sorry for the wrong information before).

So, if you have $no_add you get a duplicate entry error, is it correct? Can you try with both $no_add and $ignore?
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 26, 2015, 08:12:30 AM
one line after the other, order doesn't matter ;)
$ignore = true;
$no_add = true;

or
$ignore = $no_add = true;

Both work the same ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 26, 2015, 12:48:42 PM
brilliant so that worked

but now I am stuck here:

Converting members... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts... Successful.
Converting personal messages (step 1)...Wrong value type sent to the database. Integer expected. (id_pm_head)
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 26, 2015, 01:07:51 PM
Aren't converters great? :P

This happens (probably) because you have an empty/null value in table "Conversation" --> "FirstMessageID" (most likely due to orphaned messages). Try to replace this:
SELECT
cm.MessageID AS id_pm, cm.InsertUserID AS id_member_from, cm.DateInserted AS msgtime,
IFNULL(uc.Deleted, 0) AS deleted_by_sender, c.FirstMessageID AS id_pm_head,
SUBSTRING(IFNULL(u.Name, "Guest"), 1, 255) AS from_name, "(No Subject)" AS subject,
SUBSTRING(cm.body, 1, 65534) AS body
FROM {$from_prefix}Conversation AS c
LEFT JOIN {$from_prefix}ConversationMessage AS cm ON (c.ConversationID = cm.ConversationID)
LEFT JOIN {$from_prefix}User AS u ON (c.InsertUserID = u.UserID)
LEFT JOIN {$from_prefix}UserConversation AS uc ON (c.InsertUserID = uc.UserID AND c.ConversationID = uc.ConversationID)
GROUP BY cm.MessageID;

With:
SELECT
cm.MessageID AS id_pm, cm.InsertUserID AS id_member_from, cm.DateInserted AS msgtime,
IFNULL(uc.Deleted, 0) AS deleted_by_sender, c.FirstMessageID AS id_pm_head,
SUBSTRING(IFNULL(u.Name, "Guest"), 1, 255) AS from_name, "(No Subject)" AS subject,
SUBSTRING(cm.body, 1, 65534) AS body
FROM {$from_prefix}Conversation AS c
LEFT JOIN {$from_prefix}ConversationMessage AS cm ON (c.ConversationID = cm.ConversationID)
LEFT JOIN {$from_prefix}User AS u ON (c.InsertUserID = u.UserID)
LEFT JOIN {$from_prefix}UserConversation AS uc ON (c.InsertUserID = uc.UserID AND c.ConversationID = uc.ConversationID)
WHERE c.FirstMessageID IS NOT NULL
GROUP BY cm.MessageID;
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 27, 2015, 01:15:07 AM
Amazing - they are so much fun! :P

This happened, BTW ;)

QuoteConverting members... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)...The database value you're trying to insert does not exist: deleted

Also one thing I noticed is while the members have been migrated over successfully, the topics and posts have not... (i just checked out of curiosity)
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 27, 2015, 04:42:25 AM
At the end of the conversion - when we get there :P - you should run SMF's maintenance tools "find errors" and "recount totals". That should bring them back.
If you want to be sure, check smf's database, tables "topics" and "messages", they should be there ;)

Find this:
'deleted' => $is_deleted,

Replace with this:
'deleted' => !empty($is_deleted) ? $is_deleted : 0,
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 27, 2015, 10:14:59 AM
you, sir, \m/

now I think this is the last error (fingers crossed)

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 column name 'id_member'

YIKES!
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 27, 2015, 10:23:04 AM
Nevermind that :P

Now try to login to SMF ;) As soon as you can, dive into your Admin --> Maintenance --> Forum Maintenance --> Routine and run "Find and repair any errors" and "Recount all forum totals and statistics"

Fingers crossed ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: MasterOne on January 27, 2015, 10:36:09 AM
Any idea how to perform a Markdown to BBCode conversion throughout all forum postings and PMs?

I have (unsuccessfully) tried to convert from Vanilla 2.1.x to SMF once by working around the mentioned errors, but since we have our Vanilla running with Markdown I'd still have to find a way to convert all the Markdown to BBCode once the actual board conversion has been accomplished.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 27, 2015, 10:41:33 AM
Can you let us know which Markdown is that? ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: MasterOne on January 27, 2015, 11:26:05 AM
Quote from: margarett on January 27, 2015, 10:41:33 AMCan you let us know which Markdown is that? ;)

The regular Markdown (http://en.wikipedia.org/wiki/Markdown) Vanilla comes with. It seemed interesting and really easy at the time we started our forum, but people are so used to BBCode that it may have been the wrong decision after all, especially now with converting in mind.
Title: Re: [SMF Converter] Vanilla 2
Post by: parthans on January 27, 2015, 11:47:09 AM
THANKS A LOT THANKS A LOT

Only messages haven't synced - meaning the inbox hasnt come in - the sent messages came in fine! :)

You are a Godsend!!

Quote from: margarett on January 27, 2015, 10:23:04 AM
Nevermind that :P

Now try to login to SMF ;) As soon as you can, dive into your Admin --> Maintenance --> Forum Maintenance --> Routine and run "Find and repair any errors" and "Recount all forum totals and statistics"

Fingers crossed ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on January 27, 2015, 12:20:42 PM
Quote from: MasterOne on January 27, 2015, 11:26:05 AM
Quote from: margarett on January 27, 2015, 10:41:33 AMCan you let us know which Markdown is that? ;)

The regular Markdown (http://en.wikipedia.org/wiki/Markdown) Vanilla comes with. It seemed interesting and really easy at the time we started our forum, but people are so used to BBCode that it may have been the wrong decision after all, especially now with converting in mind.
Something like this
http://www.alfredforum.com/topic/1333-markdown-to-bbcode-20/
should help. Of course it would have to inserted in either the converter itself *or* in a script to be ran after conversion. Not for the fainted hearted, though...
Googling for "markdown to bbcode" actually brings a lot of results ;)

Quote from: parthans on January 27, 2015, 11:47:09 AM
THANKS A LOT THANKS A LOT

Only messages haven't synced - meaning the inbox hasnt come in - the sent messages came in fine! :)

You are a Godsend!!
You're welcome. Welcome to SMF ;)
Title: Re: [SMF Converter] Vanilla 2
Post by: dreyti on April 12, 2015, 07:22:07 AM
Hi all! I'm trying to convert my vanilla 2.0.18.8 to smf 2.0.9
And have this error
QuoteConverting...
Converting members...
Unsuccessful!
This query:
SELECT
m.UserID AS id_member, m.Name as member_name, m.DateFirstVisit AS date_registered,
(m.CountDiscussions + m.CountComments) AS posts, m.DateLastActive AS last_login,
CASE mr.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,
CONCAT_WS(' ', m.FirstName, m.LastName) AS real_name, m.Email 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 `forum`.GDN_User AS m
LEFT JOIN `forum`.GDN_UserRole AS mr ON (m.UserID = mr.UserID)
LIMIT 0, 500;
Caused the error:
Unknown column 'm.FirstName' in 'field list'

Previous errors I've fixed
Title: Re: [SMF Converter] Vanilla 2
Post by: dreyti on April 12, 2015, 08:16:32 AM
Quote from: dreyti on April 12, 2015, 07:22:07 AM
Hi all! I'm trying to convert my vanilla 2.0.18.8 to smf 2.0.9
And have this error
QuoteConverting...
Converting members...
Unsuccessful!
This query:
SELECT
m.UserID AS id_member, m.Name as member_name, m.DateFirstVisit AS date_registered,
(m.CountDiscussions + m.CountComments) AS posts, m.DateLastActive AS last_login,
CASE mr.RoleID WHEN 4 THEN 1 ELSE 0 END AS id_group, m.Password AS passwd,
CONCAT_WS(' ', m.FirstName, m.LastName) AS real_name, m.Email 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 `forum`.GDN_User AS m
LEFT JOIN `forum`.GDN_UserRole AS mr ON (m.UserID = mr.UserID)
LIMIT 0, 500;
Caused the error:
Unknown column 'm.FirstName' in 'field list'

Previous errors I've fixed

Fixed!
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 16, 2015, 11:47:05 PM
I'm currently trying to import 14K topics and 100K posts into SMF 2.0 RC3 from Vanilla 2.0.18.14. I've run into a few errors, which I've been able to fix, thanks to the questions made here and in other SMF converters. All members have successfully converted. I've used SMF 2.0 RC3 because that is what this converter has been tested with.

However, I have one very irritating problem. When I first "successfully" converted, I noticed that 4K threads vanished with 30K posts. I looked to see what was the difference between threads that disappear and ones that successfully convert. I noticed that all threads that had disappeared had a entry in the "DateUpdated" table in Vanilla 2. I also noticed that posts in these missing threads had managed to successfully convert, as I could see them in smf_messages. So, I looked through the data to see why they weren't appearing, I looked at the id_topic and searched for it in smf_topics, I discovered that there were no topics that had the ids listed in these missing posts. The relationship between all these missing threads is that they all have an entry in the Vanilla 2 table "DateUpdated", which is modified_time in SMF.

So, I decided to remove all DateUpdated entries and convert again. I ran these in the Vanilla 2 db:
UPDATE `GDN_Discussion` SET `DateUpdated` = NULL
UPDATE `GDN_Comment` SET `DateUpdated` = NULL

I converted again, this time all the threads and posts showed up. I thought it worked and all was well, however when I went to open one of the previously missing threads, I got "Wrong value type sent to the database. Integer expected. (id_msg)"

So, I looked in the database again and noticed that the topics had successfully converted in smf_topics, all the values were correct. But, this time the posts in smf_messages had not, they had incorrect id_board and id_topic values (they were different from the values in smf_topics). When I looked at the threads which had these ids in SMF, I noticed that the posts were actually in these threads, but multiple threads had merged together.

I'm stumped at the moment, I don't know why topics won't be created when a thread has been edited in Vanilla. Or why when I remove the DateUpdated values, the threads are successfully created, but the posts get the wrong id_topic and id_board values. I manually changed a post that had the wrong id_topic and id_board values and it loaded successfully. So, I either need to find out how to stop posts being issued the wrong values when I remove the "DateUpdated" value or fix topics not being created when a "DateUpdated" value is present.

Any help would be greatly appreciated. I've uploaded the converter I am using, as I have modified parts of it.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 17, 2015, 06:25:13 AM
Hi

Do not use 2.0 RC 3. Please use 2.0.10 and we will try to fix any issues the converter might have.

I have another converter here in my computer (I'm sorry, I cannot relate to any date of usage of it, dealing with so many converters messes my mind :P ) so please try the files attached *in 2.0.10*
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 08:15:31 AM
Quote from: margarett on July 17, 2015, 06:25:13 AM
Hi

Do not use 2.0 RC 3. Please use 2.0.10 and we will try to fix any issues the converter might have.

I have another converter here in my computer (I'm sorry, I cannot relate to any date of usage of it, dealing with so many converters messes my mind :P ) so please try the files attached *in 2.0.10*


I've just taken a look at the converter attached, when I made a difference between the converter attached and the original at the start of this thread, there were no changes. So it's the same converter. This converter has given me a few errors in the past "Wrong value type sent to the database. Integer expected. (last_login)" , duplicate entries, missing emails and so on. I just tried the converter you attached and it made the same errors. So I made a few modifications to the original converter as suggested in this thread, and some of my own edits for errors that weren't listed here.

You can see the changes I made here: https://github.com/Realms-Network/Vanilla-2-to-SMF-2/commit/e9f6dfca6335e68be58d243cd8fdcf3109fa54c1 (https://github.com/Realms-Network/Vanilla-2-to-SMF-2/commit/e9f6dfca6335e68be58d243cd8fdcf3109fa54c1)I'll try my edited converter in 2.0.10 and see how it goes :)
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 08:53:54 AM
Ok, so it looks like the topics and posts were created when I used my edited converter in 2.0.10. But they were still missing from the categories and stats. So I looked in the DB to see why, the smf_messages table looked fine. However, the smf_topics is definitely odd, id_first_msg and id_last_msg are the same value as the modified_time value of the first message of that topic id in smf_messages. When they of course should be the message ids of the last and first post.


I'll give an example, say the original message (the thread) has a modified_time value of 1367871842 then both id_first_msg and id_last_msg have 1367871842.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 17, 2015, 09:10:14 AM
Go to your ACP and perform the maintenance tasks "Find and repair errors" and "Recount totals". That should bring stuff back in place :)
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 09:28:04 AM
Quote from: margarett on July 17, 2015, 09:10:14 AM
Go to your ACP and perform the maintenance tasks "Find and repair errors" and "Recount totals". That should bring stuff back in place :)


Unfortunately, that did not put things pack into place, it just asked to fix cached words and unknown. I've repeated the find and repair errors and recount totals a few times now, but it's still not putting the correct id_last_msg and id_first_msg values in place  :-\
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 17, 2015, 09:34:04 AM
So it's not the problem I thought it was, it's something wrong with the converter really. I need to give it a closer look (although I never really touched a "vanilla" database)
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 10:08:30 AM
Quote from: margarett on July 17, 2015, 09:34:04 AM
So it's not the problem I thought it was, it's something wrong with the converter really. I need to give it a closer look (although I never really touched a "vanilla" database)


Well this code in vanilla2_to_smf.sql looks interesting:


'id_first_msg' => $row['modified_time'],
'id_last_msg' => $row['modified_time'],
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 17, 2015, 10:24:54 AM
Eh :P

Anyway that converter looks quite messed, I have to admit... It is adding a post when converting topics?
convert_insert('messages',
array(
'id_topic', 'id_board', 'poster_time', 'id_member', 'subject', 'poster_name', 'poster_email', 'poster_ip', 'modified_time', 'modified_name', 'body'),
array(
$row['id_topic'], $row['id_board'], $row['poster_time'], $row['id_member_started'], $row['subject'], $row['poster_name'], $row['poster_email'], "", $row['modified_time'], $row['modified_name'], $row['body'])
);

Then of course the IDs don't fit correctly.

I really need to get my hands on a test install here. Do you know where I cant get 2.0.something? On the site the available version is 2.1.11 and I assume that it will have database changes from the version you run...
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 10:31:04 AM
Quote from: margarett on July 17, 2015, 10:24:54 AM
Eh :P

Anyway that converter looks quite messed, I have to admit... It is adding a post when converting topics?
convert_insert('messages',
   array(
      'id_topic', 'id_board', 'poster_time', 'id_member', 'subject', 'poster_name', 'poster_email', 'poster_ip', 'modified_time', 'modified_name', 'body'),
   array(
      $row['id_topic'], $row['id_board'], $row['poster_time'], $row['id_member_started'], $row['subject'], $row['poster_name'], $row['poster_email'], "", $row['modified_time'], $row['modified_name'], $row['body'])
);

Then of course the IDs don't fit correctly.

I really need to get my hands on a test install here. Do you know where I cant get 2.0.something? On the site the available version is 2.1.11 and I assume that it will have database changes from the version you run...


Here is my version: http://vanillaforums.org/addon/vanilla-core-2.0.18.4


Just change the numbers in the link to get to different versions :P And yes, the 2.1 versions do have quite a few differences to the 2.0 versions in the db. This converter does not work at all with 2.1.
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 10:40:03 AM
Quote from: margarett on July 17, 2015, 10:24:54 AM
Anyway that converter looks quite messed, I have to admit... It is adding a post when converting topics?


Well, it has to add a post when converting topics. As Vanilla 2.0 has the first post's "subject" (called "Name" in Vanilla) and "body" (same name in Vanilla) in the table GDN_Discussion (the topic table in Vanilla) and all post's content after the first post are in the GDN_Comment table. SMF has all posts, including the first in the smf_messages table, so when converting a topic from Vanilla 2.0, one must also create a post from the GDN_Discussion table for the first post and then all following posts are in the GDN_Comment table.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 17, 2015, 11:06:58 AM
Oh I see.

I have to check with more time and attention. You can't convert the topic and give it an id_first_message if you still don't know which ID it will have... No idea how to work that out for now...
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 17, 2015, 11:21:47 AM
Quote from: margarett on July 17, 2015, 11:06:58 AM
Oh I see.

I have to check with more time and attention. You can't convert the topic and give it an id_first_message if you still don't know which ID it will have... No idea how to work that out for now...


Hmm, well it manages to do it with all topics that don't have a modified_time value in it. So, I'm not sure why having that changes things.
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on July 18, 2015, 09:50:11 AM
I've managed to convert Vanilla 2.0 to SMF successfully using the converter I attached in one of my previous posts. The converter never finished the forum statistic recalculation, so I manually entered in the next steps and ran them. This fixed the issue where topics that had been edited didn't have the right ids for first and last messages.

I might look into fixing the issue to prevent having to do the steps manually when I get some free time.
Title: Re: [SMF Converter] Vanilla 2
Post by: margarett on July 18, 2015, 01:56:56 PM
Great! :)
Title: Re: [SMF Converter] Vanilla 2
Post by: JanHoos on August 11, 2016, 07:47:09 AM
I got the logged in and date registered error as well. Fixed that with the second post in this topic.

But I encountered duplicate board error:
Converting members... Successful.
Converting boards...Duplicate entry '1' for key 'PRIMARY'
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on August 11, 2016, 08:04:10 AM
Quote from: JanHoos on August 11, 2016, 07:47:09 AM
I got the logged in and date registered error as well. Fixed that with the second post in this topic.

But I encountered duplicate board error:
Converting members... Successful.
Converting boards...Duplicate entry '1' for key 'PRIMARY'


Are you using my version: https://github.com/Realms-Network/Vanilla-2-to-SMF-2 ?
Title: Re: [SMF Converter] Vanilla 2
Post by: JanHoos on August 11, 2016, 09:02:27 AM
I am now, that certainly went a lot smoother. Converting Private Messages is giving me the following error now tho:

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/airsof76/public_html/smf/convert.php on line 492

Corresponds to this code:
list($big_selects, $sql_max_join) = $smcFunc['db_fetch_row']($results);

EDIT:
Not sure if this should be working, but it said converting posts: Succesfull. After that it went and tried doing the Private Messages that gave the error posted above.

I went and checked my forum. The categories are there but there's no topics in them unfortunately. As I said, not sure if that should be working wit the above error.
Title: Re: [SMF Converter] Vanilla 2
Post by: JanHoos on August 14, 2016, 11:05:03 AM
Bump? I'm afraid I'm stuck :(
Title: Re: [SMF Converter] Vanilla 2
Post by: DukeofRealms on August 20, 2016, 09:18:21 PM
What version of Vanilla are you trying to convert from?


Also, what version of SMF are you converting into?


I never did a test with Private Messages, not sure if that was working when I did my conversion.