Advertisement:

Author Topic: vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)  (Read 4504 times)

Offline madmigmr2

  • Newbie
  • *
  • Posts: 2
vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)
« on: March 16, 2007, 09:16:26 PM »
I'm having troubles importing from vb 3.6.4 to smf
PM messages are being imported but not properly, because they don't show up on the inbox

I'm using your latest release with the sql file posted on the sticky post and still i'm having this problem  :(

Any one had this same problem?


I managed to fix the problem manually trough phpmyadmin (sql)


- First thing you must do is import the missing data from vb to smf.
  The information you need is on the table pm

It's quite easy to import because you only need 2 columns from it (pmid and userid)

- Then you just have to create the sql to insert on your smf db, with this format:

INSERT INTO `smf_pm_recipients` VALUES (aaa, bbb, '-1', 0, 1, 0);

   Where aaa is your pmid and bbb is your userid.


- Final step is a bit of a hack but it works  ;)

   UPDATE smf_members SET instantMessages = 100

You must do this final step so messages can show up on the inbox of each user.
100 is just an example, if you know that there are users with more than 100 PM you can insert a larger number.

By default this field is 0 when you finish the conversion from vb.


I think now it's easy to fix the convert script to do this steps automatically.
   







« Last Edit: March 17, 2007, 09:24:28 PM by madmigmr2 »

Offline thinkarcade

  • Semi-Newbie
  • *
  • Posts: 17
Re: vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)
« Reply #1 on: April 03, 2007, 10:50:55 AM »
- Final step is a bit of a hack but it works  ;)

   UPDATE smf_members SET instantMessages = 100

I created a little script that will actually insert the correct number of PMs for each user instead of setting them all to 100.  The code works but I am a bit of a PHP novice so don't laugh if it isn't the most efficient way of doing things.

Code: [Select]
<?
$dbhost = 'databasehost';
$dbuser = 'databaseuser';
$dbpass = 'databasepassword';
$dbname = 'databasename';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
mysql_select_db($dbname);

$query = "SELECT ID_MEMBER, memberName FROM smf_members";
$result = mysql_query($query);
$num = mysql_numrows($result);

$i=0;
while ($i < $num) {

$memberid=mysql_result($result,$i,"ID_MEMBER");
$membername=mysql_result($result,$i,"memberName");

$query2 = "SELECT * FROM smf_pm_recipients WHERE ID_MEMBER=$memberid";
$result2 = mysql_query($query2);
$numpms = mysql_numrows($result2);

$updatesql = "UPDATE smf_members SET instantMessages=$numpms WHERE ID_MEMBER=$memberid";
mysql_query($updatesql);

echo $membername . ' with the ID ' . $memberid . ' and ' . $numpms . ' PMs has been updated!<br>';

$i++;
}

mysql_close($conn);
?>

Just change the 4 variables at the top of the file with the values for your DB and you should be all set.  Upload the file to somewhere on your site and open it with your browser. The script will output the results and will look something like this:

ir0nm0nk3y with the ID 131 and 13 PMs has been updated!
Gutspiller with the ID 129 and 4 PMs has been updated!
Gems with the ID 128 and 0 PMs has been updated!
bigbarte with the ID 127 and 37 PMs has been updated!

Offline Xanthrop

  • Semi-Newbie
  • *
  • Posts: 13
Re: vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)
« Reply #2 on: April 06, 2007, 05:51:39 PM »
Hi,

I was wondering if anyone could elaborate on this process a bit.  I understand most of it as follows:
- I'm using phpmyadmin
- I've exported the vb_pm table with complete inserts to file
- I've exported the smf_personal_messages with complete inserts to file; so I can examine it

Now, I'm lost on how to change the vb_pm to format the smf_ table.  The smf_ table format has actual pm text in it whereas the vb_pm table I think references another vb_pmtext table.

Any input on a correct export/import process of just the PMs would be a great help.  The rest of the conversion went extremely well.

Thanks,
Xanthrop

Offline Xanthrop

  • Semi-Newbie
  • *
  • Posts: 13
Re: vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)
« Reply #3 on: April 07, 2007, 01:45:04 PM »
Nevermind,

I had been working on a conversion to phpbb before I had found this software.  I had the conversion to phpbb working so I decided to stage vbulletin 3.0.7 in to phpbb then convert from phpbb to smf.

This fixed the PM issue, however, it introduced a password issue.  The password gets botched on the conversion from vb to phpbb, so there's no fix there.

I'm all set though, everything else is working and I disabled my vb forum with a message saying e-mail me to get the url and info for the new board.  Not many users, just 10's of thousands of posts and pms spanning 3-4yrs.

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)
« Reply #4 on: April 16, 2007, 03:44:22 PM »
Were the password working in the phpBB conversion?  Also you can get your users to do a forgot password and request a new password.
Follow me on Twitter

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