News:

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

Main Menu

VB 3.5 Converter needs updated - read

Started by mtindor, December 29, 2007, 09:15:04 PM

Previous topic - Next topic

mtindor

The VB 3.5 converter available at http://www.simplemachines.org/download/?converters  needs to be  updated / corrected.

Specifically, it is the SQL in vbulletin35_to_smf.sql that is the problem.

The problem is that the current SQL obtains data from the pmreceipt table.  In VB, the pmreceipt table does not have entries for all PMs.   It only has entries for those PMs actively in some sort of state of acceptance/denial of receipt by the recipient.

Instead, the code should pull its data from the pmtable.    All of the needed information is in the pm table.   The where clause in my proposed code makes sure that entries in the pm table with a folderid of -1 are not copied over.   In VB's pm table, the folderid value indicates whether the PM belongs to the sender (in the senders outbox) - value -1, or whether the PM belongs to the recipient (0 = inbox; a value of  +1 or greater indicates a VB PM subfolder.).   You don't want the messages with a folderid of -1 to be ported over because they will end up in the inbox of the sender.   So the where clause takes care of that.

disclaimer:  I'm no SQL guru, far from it.

Current Code:


/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
        pm.pmid AS ID_PM, pm.touserid AS ID_MEMBER, pm.readtime != 0 AS is_read, '-1' AS labels
FROM {$from_prefix}pmreceipt AS pm;
---*


Proposed Code:


/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
        pm.pmid AS ID_PM, pm.userid AS ID_MEMBER, pm.messageread != 0 AS is_read,
        '-1' AS labels
FROM {$from_prefix}pm AS pm
WHERE pm.folderid != '-1';
---*


mtindor

Also, I see that ALL of the messages (not PMs) that are converted are set as unread - on our board, that's 27000 unread.

So the converter doesn't appear to be converting whether a post is read or not.

Mike

JayBachatero

Thanks for the report.  I'll update the converter :).
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: