[SMF Converter] PHP-Fusion 7

Started by ThorstenE, February 21, 2009, 02:08:44 PM

Previous topic - Next topic

szoller

QuoteWe do not allow editing of posts after a few minutes on the forum.
Ah, thank you, so I was just too late :)

QuoteCan you run the query via mysql such as phpmyadmin
[...]

After the latest try, the error was:
Converting...
Converting attachments...
Successful.
Converting membergroups... Successful.
Recalculating forum statistics... Unsuccessful!
This query:

    UPDATE `tda_smf`.qpx_topics
    SET id_first_msg = '101154',
    id_member_started = '4973', id_last_msg = '101162',
    id_member_updated = '75', num_replies = '6'
    WHERE id_topic = 6982
    LIMIT 1;

Caused the error:

    1062


So I used the message above, phpmyadmin said:
SQL-Befehl:

UPDATE `tda_smf`.qpx_topics
SET id_first_msg = '101154',
id_member_started = '4973', id_last_msg = '101162',
id_member_updated = '75', num_replies = '6'
WHERE id_topic = 6982
LIMIT 1

MySQL meldet: Dokumentation
#1062 - Doppelter Eintrag '101154-6' für Schlüssel 'first_message'


What can I do? Between each try I cleared all database field that contained imported data, so this should not happen.

Do you also have an Idea regarding the attachment problem?

vbgamer45

Try this convert.php for the second issue.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

szoller

Looks like the last part worked, thank you!

Unfortunately there is still the problem with the attachments, could you help me with that, too? :)

I'm clueless, maybe the error message from #116 is the reason, i don't know :(

szoller

I tried around, but there is always (depending on the SQL) file a message:

First, with "official" SQL file (Downloads > Converters > PHP Fusion 7) and convert.php from @vbgamer45:

QuoteConverting attachments...The database value you're trying to insert does not exist: id_attach
and the process stops (~500 files in attachments folder, no database entry for attachments).

PHP error log: :07:05.994735 2020] [proxy_fcgi:error] [pid 32312:tid 140479656032000] [client *IP*:51774] AH01071: Got error 'PHP message: PHP Notice:  Undefined index: convert_script in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 987PHP message: PHP Warning:  Invalid argument supplied for foreach() in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 990
PHP message: PHP Notice:  Undefined index: convert_script in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 1002', referer: https://PAGENAME/smf/convert.php
[Fri Jan 17 20:07:05.995076 2020] [proxy_fcgi:error] [pid 32312:tid 140479656032000] [client *IP*:51774] AH01071: Got error 'PHP message: PHP Deprecated:  strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 2449
PHP message: PHP Notice:  Undefined variable: result in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 2510PHP message: PHP Notice:  Undefined variable: result in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 2511
PHP message: PHP Notice:  Undefined index: db_fetch_assoc in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 1401
PHP message: PHP Fatal error:  Uncaught Error: Function name must be a string in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php:1401\nStack trace:\n#0 /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php(1341): doStep2()\n#1 /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php(51): doStep1()\n#2 {main}\n  thrown in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php on line 1401', referer: https://PAGENAME/smf/convert.php
[b]PHP message: PHP Warning:  A non-numeric value encountered in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php(1269) : eval()'d code on line 4[/b]*

Last (bold marked) line appears more than 4400 times in the logfile (quick word search for "non-numeric value encountered"  8) )


Next try with Github SQL-file and convert.php from @vbgamer45:
QuoteConverting...
Converting attachments...
Successful.
Converting membergroups... Successful.
Recalculating forum statistics... Successful.
Conversion Complete
So it seems to be finished  ( There are 10 005 files in attachments folder, (seems to be okay) but (this time) 11 database entries for attachments).

[Fri Jan 17 21:27:19.490425 2020] [proxy_fcgi:error] [pid 32312:tid 140479882856192] [client *IP*:60438] AH01071: Got error 'PHP message: PHP Warning:  A non-numeric value encountered in /var/www/vhosts/PAGENAME/httpdocs/smf/convert.php(1269) : eval()'d code on line 4
This line also appears more than 4400 times in the logfile (quick word search for "non-numeric value encountered"  8) ) seems to be the same issue than above.

I tried also the official convert.php and the Github one, the result depends on the SQL-file (see above).

Regarding the PHP Fusion database, there should be around 10000 attachments.

So can someone help? Do you need further information?

vbgamer45

Can you explain PHP fusion more I haven't used it before. Is it just a downloads system or does it do more with posts?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

szoller

PHP Fusion is a CMS-system with integrated forum. The attachments are related to forum posts, mostly they are pictures in my case.


Downloads are not included with this converter, but i dont need it also. Just the forum contents including the post attachments would be fine.

szoller

Do you need further information? :)

szoller

Isn't there somebody out there who can help me?  :)
I'd spend a coffee or two for some help  ;D

szoller

Can I do something to make it easier to help me? Id does not have to be for free of course, i just need to convert attachments, too :/

szoller

So, no way to help me? As you notice, i'm quite desparate

vbgamer45

It would probably have to be done via a script that is manually created. Would take probably 2 to 3 hours of work depending on the format.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

szoller

So it becomes quite expensive? Myself - i do not have the knowledge to do this :(
I mean, in general, the parts seem to work besides this "bug"...

szoller

Is there someone who would do that for me? If yes, let me know the prize. I can give access then

szoller

#133
For me it looks like there's something wrong with the attach_id as all files inserted in the new attachment folder begin with 1_ (which should be the attachment ID as far I can read the script).
It looks like there is a block of 500 items copied, after that i guess the mysql entries should be inserted which seems to fail...

20$ for the person that helps me find a solution  :laugh:

Edit:
now i inserted a dummy entry in the database, now the system runs multiple runs to copy all the files, but per run, there are only 1-2 database entries added...

szoller

#134
Even if i'm the only one answering me... i made some progress

in the phpfusion7_to_smf.sql i changed line 232:
$rows[] = array(
'id_attach' => $id_attach,


to

$rows[] = array(
'id_attach' => $row['id_attach'],



the result is that all files are copied and there are database entries for all the files.

Problems I found:

  • Due to the change, the file names are wrong, the file prefix seems to be the one of the first item that has been processed in the block, so I have (i guess) blocks with 500 items with the same prefix and their hashes then. The result is that attachments are not working due to missing files (404).
  • For only one item per processing block (?), width and height of an image seems to be processed, so I have only 5 items where this information has been added, the others contain the zero values (Thinking of it, 5 items with this information seems to be less than processing blocks...)

For the first issue, a script could rename the files using the database (lookup for the ID using the hash values), but i'm not able to program it unfortunately.

vbgamer45

I think it should be 'id_attach' => $id_attach,

I checked all the other convertors and it is like that but I would also change

$file_hash = getAttachmentFilename($row['filename'], $row['id_attach'], null, true);

To

$file_hash = getAttachmentFilename($row['filename'], $id_attach, null, true);

I noticed PHP Fusion was the only who had that statement above changed.
Let me know if that helps.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

szoller

Nearly there.

I found out that i had to change the sql file in two places to make it work.

First (as already mentioned):
in the phpfusion7_to_smf.sql i changed line 232:

$rows[] = array(
'id_attach' => $id_attach,


to
$rows[] = array(
'id_attach' => $row['id_attach'],


Second:

$physical_filename = $id_attach . '_' . $file_hash;

to

$physical_filename = $row['id_attach'] . '_' . $file_hash;


The variable $id_attach seems to be not available, using the $row array seems to work.

Thanks a lot, i'm done!

vbgamer45

Added changes to next release update. thanks for the information
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

szoller


Advertisement: