News:

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

Main Menu

[SMF Converter] Drupal 6.2

Started by SleePy, May 27, 2008, 05:05:28 PM

Previous topic - Next topic

ThorstenE

Haven't tested the converter for a while, I'll check it during the next days.. maybe I can fix some remaining bugs.

sharks

Thanks for looking into this very useful converter, TE. I'm very eagerly awaiting for your updates.

I downloaded and installed 6.2 specifically for this conversion, and then also tried to convert but this is the latest from a long list of errors and now i have no idea what to do to fix this:

Converting...
Converting members... Successful.
Converting categories...
Warning: Invalid argument supplied for foreach() in /home/user/public_html/test/convert.php(941) : eval()'d code on line 11
Successful.
Converting boards... Unsuccessful!
This query:

    INSERT IGNORE INTO `user_test`.test_boards
    (ID_BOARD, name, description, ID_PARENT, ID_CAT)
    VALUES ('3' , 'I hope that's not what it looks like...' , '' , '0' , '0');

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's not what it looks like...' , '' , '0' , '0')' at line 3

sharks

Unfortunately, if you want to convert to the best alternative (SMF) this converter still does not work. Nobody cares to fix this? I guess not. :(

Nao 尚

jeffreyfrog = spammer.

sharks> Obviously, the converter has a bug here. It should be using $smcFunc['db_escape_string']() on the 'name' string before inserting it.
Is that the only bug that stops your conversion from succeeding?
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Nao 尚

OT-- Hey, nice little bug... jeffreyfrog's link is active when you view it from his profile.
http://www.simplemachines.org/community/index.php?action=profile;area=showposts;u=255574
Obviously, this is unwanted, isn't it?
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

Thanks for your concern, Nao. I am currently reinstalling and converting my WordPress blog to Drupal to test your bug fixes in the converter.

I had given up hope as nobody seems active anymore, and deleted my Drupal blog.

Thanks again for being helpful. :)

Nao 尚

Well, I'm only here because I'm extremely bored because I can't work because I've fixed most of the bugs I assigned to myself and now I'm supposed to wait until dozens of persons read my patches and confirm I can commit them but so far no one has taken a look at them. So, yeah, you could have waited even more for a fix... (I only fix bugs I see reported on the bug tracker, really.)

Technically, maybe the bug *was* discussed in the team boards. I wouldn't know, though, because I have yet to be made a team member. (Insert VERY LONG blank stare here.)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

I understand your frustration Nao... Let's hope the SMF boss/es finish what they started, one day. I hope before 2011, we get to see SMF 2.0 Final.

Anyway, i have a Blogger blog, and i just finished importing all posts to WordPress 2.9.2 (3.0 Final was just released minutes ago!!) and now i'm going to import it to Drupal 6.2 (the old one released in 2008, used by this importer).

Maybe if you want to keep the boredom a bit far away, i can let you do this Drupal to SMF conversion? I'm not sure what you mean by the code changes above... I can PM you with my logins. I have tried this many many times but failed pathetically to produce anything in my SMF forum other than an erased category board and then nothing.

Nao 尚

'kay, if it fails, send me your login stuff. Mostly phpMyAdmin will be useful.

The problem with 2.0 is that it's coming soonish, so there's added pressure on code quality. Perhaps a bit too much really... :-\
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

#29
Here is what my latest conversion says:

Converting...
Converting members... Successful.
Converting categories...
Warning: Invalid argument supplied for foreach() in /home/sharks/site/forum/convert.php(941) : eval()'d code on line 11
Successful.
Converting boards... Unsuccessful!
This query:

    INSERT IGNORE INTO `sharks_smf`.smf_boards
    (ID_BOARD, name, description, ID_PARENT, ID_CAT)
    VALUES ('3' , 'I hope that's not what it looks like...' , '' , '0' , '0');

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's not what it looks like...' , '' , '0' , '0')' at line 3


EDIT: PM sent. :)

Nao 尚

Well the db_escape_string wasn't applied was it...?
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

#31
Quote from: Nao on June 17, 2010, 05:14:14 PM
Well the db_escape_string wasn't applied was it...?

I have no idea. I haven't changed any of the code from anywhere. I just used the converter files attached in the first post of this thread.
I ran the converter only once, to see what would happen, and it generated the errors in my previous post. The same errors as it always does.
My blank SMF forum then turned out like it did, with no category title, and 2 boards, each with the titles of some of the post tags from my blog. No posts and no topics were carried over.

If you could edit the original converter files to include the necessary fixes, i could run it again and inform you of the results. Or if you want, you can do it, if you think it would go faster to test the code changes. :)

Nao 尚

Quote from: sharks on June 17, 2010, 05:24:17 PM
I have no idea. I haven't changed any of the code from anywhere. I just used the converter files attached in the first post of this thread.
I looked into it... It's pure SMF1 code so I had to change it differently.

QuoteIf you could edit the original converter files to include the necessary fixes, i could run it again and inform you of the results. Or if you want, you can do it, if you think it would go faster to test the code changes. :)
See attachment. Obviously untested, but it should at least fix your current issue.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

I have renamed your attachment from drupal.sql to drupal62_to_smf.sql and placed it in the SMF folder.
I ran it and this is the output:

Converting...
Converting members... Successful.
Converting categories...
Warning: Invalid argument supplied for foreach() in /home/sharks/site/forum/convert.php(941) : eval()'d code on line 11
Successful.
Converting boards...
Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Warning: Invalid argument supplied for foreach() in /home/sharks/site/forum/convert.php(941) : eval()'d code on line 11
Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Converting posts - Part 2(this may take some time)... Successful.
Converting attachments... Unsuccessful!
This query:

    SELECT u.nid AS ID_MSG, f.filename, f.filepath
    FROM `sharks_drupal`.drupal_upload AS u
    LEFT JOIN `sharks_drupal`.drupal_files AS f ON (u.fid = f.fid)
    LIMIT 0, 500;

Caused the error:

    Table 'sharks_drupal.drupal_upload' doesn't exist



I checked the SMF forum and it has created a new board for every different category from my WordPress blog, but there are 0 topics and 0 posts in all of them. Also, i have 5 members on my WordPress blog and it has only converted one member; admin.

Nao 尚

In my script -- look for $row[name] and $row[description] and replace with $row['name'] and $row['description'], this will get you rid of the warnings.
As for the foreach() error, make sure you have at least one 'category'? Because that's the only thing that's being looped...

As for drupal_upload, well, is it certain that Drupal 6.2 creates that table? If not, try to find out how to create it.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

sharks

I did what you asked, but i am stuck on how to create a new table with the proper number of columns, rows, etc. I Google'd for it but ultimately the conversion failed as i managed to create the table but the configuration of that table is flawed. I have no experience whatsoever with SQL:


Converting...
Converting members... Successful.
Converting categories...
Warning: Invalid argument supplied for foreach() in /home/sharks/site/forum/convert.php(941) : eval()'d code on line 11
Successful.
Converting boards...
Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant name - assumed 'name' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Notice: Use of undefined constant description - assumed 'description' in /home/sharks/site/forum/convert.php(1109) : eval()'d code on line 6

Warning: Invalid argument supplied for foreach() in /home/sharks/site/forum/convert.php(941) : eval()'d code on line 11
Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Converting posts - Part 2(this may take some time)... Successful.
Converting attachments... Unsuccessful!
This query:

    SELECT u.nid AS ID_MSG, f.filename, f.filepath
    FROM `sharks_drupal`.drupal_upload AS u
    LEFT JOIN `sharks_drupal`.drupal_files AS f ON (u.fid = f.fid)
    LIMIT 0, 500;

Caused the error:

    Unknown column 'u.nid' in 'field list'

Nao 尚

Why are the 'name' errors still there? Did you actually apply my change or not...?

As for upload, just have two INT fields named 'nid' and 'fid', apparently...
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Norv

Perhaps it's better if you could export the structure of your Drupal database: phpMyAdmin > select the drupal database > "export" tab > export all tables from Drupal, as "structure only", no data, into a file.
Then attach that file here.

It seems the converter expects the Drupal attachments to be in a table drupal_upload, when your installation may have something changed. Also, can you please tell (sorry if you did and I missed it, very on the run) what exact version of Drupal are you running?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sharks

@Nao I applied ALL the changes that you have said. But i have no idea how to create another table called "drupal_upload". Any simple instructions or sql query that i can just paste and run? I have attached your sql file as drupal.sql that i have modified according to what you told me.

@Norv My Drupal versions is 6.2 - it's the exact version that is used by this converter.
I have attached an export of my sql drupal structure only.

Norv

I wonder, does your Drupal have attached files (uploaded files)? Except avatars.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: