News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[SMF Converter] Vanilla 2

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

Previous topic - Next topic

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans


margarett

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
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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 [nofollow]
QuoteNote:

As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead

margarett

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.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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.

margarett

Are you using the converter from the first post in this topic or the one from the downloads section of the site?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

I am using the converter from the start of this thread... The one from the "downloads" section doesn't even work to start with.

margarett

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?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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?

margarett

one line after the other, order doesn't matter ;)
$ignore = true;
$no_add = true;

or
$ignore = $no_add = true;

Both work the same ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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)

margarett

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;
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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)

margarett

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,
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

parthans

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!

margarett

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 ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

MasterOne

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.

margarett

Can you let us know which Markdown is that? ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

MasterOne

Quote from: margarett on January 27, 2015, 10:41:33 AMCan you let us know which Markdown is that? ;)

The regular hxxp:en.wikipedia.org/wiki/Markdown [nonactive] 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.

Advertisement: