News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[SMF Converter] vBulletin 3.7

Started by SleePy, September 17, 2008, 03:03:37 PM

Previous topic - Next topic

Kool22Masta

My vbulletin is located on another server than my SMF.
When I use the URL of the vbulletin, it doesnt work.

So i uploaded the sql file with the vbulletin database in it to the server where the smf and the converter are.
instead of the vbulletin url i just put in the url of the sql file, and the converter said that it worked, but nothing happend in the SMF forum.

Wouldnt it be much easier if there were a converter, where you just put in an sql backup and then it just puts out an sql file that i can import into smf, so it would work for everyone?

ThorstenE

Quote from: Kool22Masta on June 25, 2009, 07:47:44 PM
My vbulletin is located on another server than my SMF.
When I use the URL of the vbulletin, it doesnt work.

Both Forums (SMF and vBulletin) must be installed on the same server .. please check:
Converting to SMF

ecmrf

I just converted a VB 3.8.1 board, all went well except :

Converting members... Successful.
Converting administrators... Successful.
Converting categories... Successful.
Converting boards... Successful.
Assigning boards to categories... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll votes... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Successful.
Converting topic notifications... Successful.
Converting board notifications... Successful.
Converting smileys... Successful.
Converting attachments...
Fatal error: Call to undefined function getAttachmentFilename() in /home/muster/public_html/ecmrf.com/forum/convert.php(1097) : eval()'d code on line 26


Is there anything I need to do?

ThorstenE

sorry, the script attached to the first post is for SMF 1.1.8, attachments was redisigned for SMF 1.1.9..

you can replace the last two blocks in vbulletin37_to_smf.sql (attachments and avatars) with this code:

/******************************************************************************/
--- Converting attachments...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MSG', 'downloads', 'width', 'height');

if (!isset($vb_settings))
{
$result = convert_query("
SELECT varname, value
FROM {$from_prefix}setting
WHERE varname IN ('attachfile', 'attachpath', 'usefileavatar', 'avatarpath')
LIMIT 4");
$vb_settings = array();
while ($row2 = mysql_fetch_assoc($result))
{
if (substr($row2['value'], 0, 2) == './')
$row2['value'] = $_POST['path_from'] . substr($row2['value'], 1);
$vb_settings[$row2['varname']] = $row2['value'];
}
mysql_free_result($result);
}

// Is this an image???
$attachmentExtension = strtolower(substr(strrchr($row['filename'], '.'), 1));
if (!in_array($attachmentExtension, array('jpg', 'jpeg', 'gif', 'png')))
$attachmentExtention = '';

// Set the default empty values.
$width = '0';
$height = '0';

$newfilename = getLegacyAttachmentFilename($row['filename'], $ID_ATTACH);
if (empty($vb_settings['attachfile']))
{
$fp = @fopen($attachmentUploadDir . '/' . $newfilename, 'wb');
if (!$fp)
return;

fwrite($fp, $row['filedata']);
fclose($fp);
}
elseif ($vb_settings['attachfile'] == 1)
{
if (!copy($vb_settings['attachpath'] . '/' . $row['userid'] . '/' . $row['attachmentid'] . '.attach', $attachmentUploadDir . '/' . $newfilename))
return;
}
elseif ($vb_settings['attachfile'] == 2)
{
if (!copy($vb_settings['attachpath'] . '/' . chunk_split($row['userid'], 1, '/') . $row['attachmentid'] . '.attach', $attachmentUploadDir . '/' . $newfilename))
return;
}

// Is an an image?
if (!empty($attachmentExtension))
list ($width, $height) = getimagesize($attachmentUploadDir . '/' . $newfilename);

$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes($row['filename']) . "', $row[ID_MSG], $row[downloads], '$width', '$height'";
$ID_ATTACH++;
---}
SELECT
postid AS ID_MSG, counter AS downloads, filename, filedata, userid,
attachmentid
FROM {$from_prefix}attachment;
---*

/******************************************************************************/
--- Converting avatars...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MEMBER');

if (!isset($vb_settings))
{
$result = convert_query("
SELECT varname, value
FROM {$from_prefix}setting
WHERE varname IN ('attachfile', 'attachpath', 'usefileavatar', 'avatarpath')
LIMIT 4");
$vb_settings = array();
while ($row2 = mysql_fetch_assoc($result))
{
if (substr($row2['value'], 0, 2) == './')
$row2['value'] = $_POST['path_from'] . substr($row2['value'], 1);
$vb_settings[$row2['varname']] = $row2['value'];
}
mysql_free_result($result);
}


$newfilename = getLegacyAttachmentFilename($row['filename'], $ID_ATTACH);
if (strlen($newfilename) > 255)
return;
elseif (empty($vb_settings['usefileavatar']))
{
$fp = @fopen($attachmentUploadDir . '/' . $newfilename, 'wb');
if (!$fp)
return;

fwrite($fp, $row['filedata']);
fclose($fp);
}
elseif (!copy($vb_settings['avatarpath'] . '/avatar' . $row['ID_MEMBER'] . '_' . $row['avatarrevision'] . '.gif', $attachmentUploadDir . '/' . $newfilename))
return;

$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes($row['filename']) . "', $row[ID_MEMBER]";
$ID_ATTACH++;
---}
SELECT ca.userid AS ID_MEMBER, ca.filedata, ca.filename, u.avatarrevision
FROM ({$from_prefix}customavatar AS ca, {$from_prefix}user AS u)
WHERE u.userid = ca.userid;
---*

digger

Quote from: TE on July 09, 2009, 02:07:27 AM
sorry, the script attached to the first post is for SMF 1.1.8, attachments was redisigned for SMF 1.1.9..

you can replace the last two blocks in vbulletin37_to_smf.sql (attachments and avatars) with this code:

Converting attachments...
Fatal error: Call to undefined function getLegacyAttachmentFilename() in /home/uaforumo/domains/uaforum.org/public_html/new/convert.php(1097) : eval()'d code on line 26

ThorstenE

digger, have you replaced the attachments conversion from the orginal script with my version above? the error you posted is related to our old attachments conversion.

Sayrex

convert.php for vbulletin 3.7 is not available for download...
please check convert.php link .  :(

ThorstenE

convert.php is the same file for ALL of our converters, you can download any converter from our downloads page and use the included convert.php, you only need the custom board_to_smf.sql (vbulletin37_to_smf.sql).

navjotjsingh

I am getting a error:


Converting posts (this may take some time)... Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll votes... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Unsuccessful!
This query:

    SELECT
    pm.pmid AS ID_PM, pm.userid AS ID_MEMBER, pm.messageread != 0 AS is_read,
    '-1' AS labels
    FROM `navjot_careertalk`.vb_pm
    LIMIT 0, 500;

Caused the error:

    Unknown column 'pm.pmid' in 'field list'



How to get past this?

I am trying to convert vb 3.8.1 to SMF 1.1.0.

ThorstenE

mhh, seems like vBulletin changed their database structure in version 3.8.1

can you please check the table vb_pm with phpMyAdmin? is there a column named pmid?

Fisch.666

Hi!

I have the same problem like navjotjsingh when i try to convert my vbulletin 3.8.3 into smf 1.1.10.

There is an table called vb3_pm with an column called pmid in my database and the first step of the personal messages conversion with this query:

SELECT
pm.pmid AS ID_PM


runs without a problem. Any hints how we can fix this? Thanks in advance for an reply.

ThorstenE

navjotjsingh or Fish.666,
can anyone take a screenshot from the table vb3_pm.. (the structure -> column names are important)?

Thank you

Fisch.666

Hi!

Thanks again for your reply. I don't have accesss to phpmyadmin, but i hope this screens are ok:


navjotjsingh

Attached is the structure from my screenshot.


ThorstenE

ok, thank you :) it's a bug in vbulletin37_to_smf.sql:

in vbulletin37_to_smf.sql replace:

SELECT
pm.pmid AS ID_PM, pm.userid AS ID_MEMBER, pm.messageread != 0 AS is_read,
'-1' AS labels


with:
SELECT
pmid AS ID_PM, userid AS ID_MEMBER, messageread != 0 AS is_read,
'-1' AS labels

navjotjsingh

Thanks it worked. But for converting attachments for each attachment it shows this error:


Warning: copy(attachments/1/1.attach) [function.copy]: failed to open stream: No such file or directory in /home/navjot/public_html/sdemo/convert.php(1097) : eval()'d code on line 42


And for avtar it showed:

Warning: copy(/home/navjot/public_html/careertalk/customavatars/avatar378_1.gif) [function.copy]: failed to open stream: No such file or directory in /home/navjot/public_html/sdemo/convert.php(1097) : eval()'d code on line 30


Rest everything went smooth.

None of the avatar or attachment were converted.

Fisch.666

Hi!

Thanks again for your help, the import works now without a problem.  :)

SimpleJoe

I get a blank page that says "SMF Converter" but there's no other data:
http://birdcarversonline.com/convert.php

Both VB and SMF are using the same database on the same server ... any ideas?
Hosting Simple Machines since YaBB -- One of the first SMF Forum Hosting providers with Chat and FTP for the inner developer in us all.

ThorstenE

a blank page is often server related (strict php configuration: e.g. memory_limit, max_execution_time ...)
Any chance to modify the php.ini or to check the webservers error log?

Workaround: make a backup from your vBulletin and convert it on your local computer (XAMPP is an easy installable Webserver incl. PHP- and MySQL)

navjotjsingh

Quote from: navjotjsingh on July 17, 2009, 08:30:10 AM
Thanks it worked. But for converting attachments for each attachment it shows this error:


Warning: copy(attachments/1/1.attach) [function.copy]: failed to open stream: No such file or directory in /home/navjot/public_html/sdemo/convert.php(1097) : eval()'d code on line 42


And for avtar it showed:

Warning: copy(/home/navjot/public_html/careertalk/customavatars/avatar378_1.gif) [function.copy]: failed to open stream: No such file or directory in /home/navjot/public_html/sdemo/convert.php(1097) : eval()'d code on line 30


Rest everything went smooth.

None of the avatar or attachment were converted.

Please look at my error too.

Advertisement: