News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Command line convertion problems

Started by maple03, October 29, 2008, 04:42:45 PM

Previous topic - Next topic

maple03

Hello everyone.
I want to give smf a try, so I've installed smf and it went fine. Then I tried to use convert.php from the web, but as a forum is quite big convertion gets stuck for hours and I get session timeout errors.

So, as suggested here, I tried to use convert.php in the CLI like this:
/usr/bin/php -f /home/some/path/here/smf/convert.php --path_to /home/some/path/here/smf --path_from /home/some/another/path/forum --convert_script /home/some/path/here/smf/invision23_to_smf.sql --db_pass password


And everything I get - is html page printed to the terminal with the same page I could see if I would try to use web covertion.

What am I not doing right?

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03

No. It's the page I can see when I use convert.php from the web. With all the options of path and codepage.

SleePy

Can you create a phpinfo.php file with the following contents.

<?php
phpinfo
();
?>



Run this through command line, and email me the contents (In a text file would be nice).
I am having a feeling your OS or php version is reporting that it is from command line differently than what the converter is looking for.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03


SleePy

That wont help :(

I need to see the output that is generated by your command line program rather than my browser.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03

#6
Ok. I've got the output from the shell. But your e-mail is not visible and I cannot attach file if I send you e-mail via this forum. What to do?

UPD link to the text file is sent.

SleePy

Hmm, ok.
Lets try this.

Open the convert.php
Find:
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']))

Replace:
if ((php_sapi_name() == 'cli' || $_SERVER['TERM'] == 'xterm') && empty($_SERVER['REMOTE_ADDR']))

That hopefully should take care of this.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03

#8
It started working but no actual conversion is done.
Here is the output in less then a second after running script:

Starting Conversion
Successful.
* Recalculating forum statistics...  Successful.

Conversion Complete!
Please delete this file as soon as possible for security reasons.
<br />
<b>Notice</b>:  Undefined index:  convert_script in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>810</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>813</b><br />
<br />
<b>Notice</b>:  Undefined index:  convert_script in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>825</b><br />
<br />
<b>Notice</b>:  Undefined index:  convert_script in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>721</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1208</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1218</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1226</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1249</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1262</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1308</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1310</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1316</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1322</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1333</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1334</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1342</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1344</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1350</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1351</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1357</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1358</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1382</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1384</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1390</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1402</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1427</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1429</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1473</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1488</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1517</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1519</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1532</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1554</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1559</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1620</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1622</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1658</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1677</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_row(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1700</b><br />
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>1701</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2408</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />
<br />
<b>Warning</b>:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2408</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2236</b><br />
<br />
<b>Notice</b>:  Undefined variable:  result in <b>/home/limpbizk/public_html/rst-uanic/smf/convert.php</b> on line <b>2237</b><br />

SleePy

Common conversion errors.

We are having the session save path issue here that means.
Or you might not of gave enough input parameters.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03

#10
I've made corrections to php.ini for hxxp:session.save [nonactive]_path:
session.save_path = /tmp
/tmp is writable and session information is stored there in a files that look like sess_sessionid.

Input parameters are: //usr/bin/php -f /home/limpbizk/public_html/rst-uanic/smf/convert.php -- --path_to=/home/limpbizk/public_html/rst-uanic/smf --path_from=/home/limpbizk/public_html/forum --convert_script=/home/limpbizk/public_html/rst-uanic/smf/invision23_to_smf.sql --db_pass=apassword  --debug

But still the same result. What to look at next?

ThorstenE

I'm not sure but have you tried php without the -f (most php environments doesn't need it)..
also there is a syntax error in your code above (marked red)
Quote.....html/rst-uanic/smf/convert.php -- --path_to=/.....

maple03

Thank you for your help,  but unfortunately - the same result.
Any other ideas?

SleePy

Was your server running on windows?
I know your site is running apache and a old version of php (which you should tell your host to upgrade, fyi).
I don't know if that is having a factor here in this issue, but it is possible.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

maple03

Server is running some kind of linux with jail environment, I am not sure exactly.
I can see session file created for this script but still the same result. Can php version impact the script behavior?

ThorstenE

sounds like netBSD or adamantix?!? the jail environment is possibly the problem.. maybe you can export your forum, convert it  on your local system (with XAMPP for example) and then transfer the converted SMF back to the host?!?

maple03

Interesting idea. I will try to do it this way.

ThorstenE

any luck with the local conversion, maple03? If you still need our assistence let us know ..

Advertisement: