vb 3.6.4 to smf problem: pm messages (PROBLEM FIXED)

Started by madmigmr2, March 16, 2007, 09:16:26 PM

Previous topic - Next topic

madmigmr2

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.
   








thinkarcade

Quote from: madmigmr2 on March 16, 2007, 09:16:26 PM
- 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.


<?
$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!

Xanthrop

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

Xanthrop

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.

JayBachatero

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

Advertisement: