News:

Wondering if this will always be free?  See why free is better.

Main Menu

[SMF Converter] Drupal 6.2

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

Previous topic - Next topic

sharks

#40
My Drupal installation has no attached files and no avatars. It was a blank and brand new 6.2 installation that has been filled with posts imported from my WordPress blog. All the converted posts display fine on the Drupal blog.

Norv

Perhaps you can try: (in the sql file)
Code (find) Select

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

---* {$to_prefix}attachments
---{
$no_add = true;

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

if (strlen($physical_filename) > 255)
return;

$oldfile = $_POST['path_from'] . '/' . $row['filepath'];
if (file_exists($oldfile) && copy($_POST['path_from'] . '/'.$row['filepath'], $attachmentUploadDir . '/' . $physical_filename))
{
@touch($attachmentUploadDir . '/' . $physical_filename, filemtime($row['filename']));
$rows[] = array(
'id_attach' => $id_attach,
'size' => filesize($attachmentUploadDir . '/' . $physical_filename),
'filename' => basename($row['filename']),
'file_hash' => $file_hash,
'id_msg' => $row['id_msg'],
'downloads' => 0,
);

$id_attach++;
}
---}

SELECT u.nid AS id_msg, f.filename, f.filepath
FROM {$from_prefix}upload AS u
LEFT JOIN {$from_prefix}files AS f ON (u.fid = f.fid);
---*

and remove it, at least for the time being.
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

#42
I did exactly what you said and this is what i get:


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...
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 avatars... Successful.
Recalculating forum statistics... Successful.


Now, i go to my forum, and... there are 0 posts and 0 topics!

There are only 2 improvements:
- Now, the category is still here, and has not been deleted. In all previous attempts, i had to do forum maintenance fixing, to recover the boards, as there was no category at all after running the converter, which i assume deleted the category, without affecting the boards it contained.
- All members have been converted from Drupal.

P.S. I had the serious impression that the posts were not being parsed, as i have over 4000 posts on Drupal and it took maybe 1.5 seconds for the whole conversion.

Norv

Could you please run Admin > forum maintenance > Recount all forum statistics?
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

I just ran those 2 options:

Find and repair any errors.
Recount all forum totals and statistics.

Both were successful (no problems found), and still 0 posts and 0 topics.

Norv

Ah, I just read your edited post, obviously they weren't done...
It seems the problems are here: (sql file)

$request = convert_query("
SELECT value
FROM {$from_prefix}variable
WHERE name ='forum_containers'
LIMIT 1");

This does not result in a list of categories, as the converter expects.
Could you please run in phpmyadmin: (on drupal db)

SELECT * FROM drupal_variable WHERE name LIKE 'forum';

and post the result here, if any.

Or, you could perhaps export only the table drupal_variable, both structure and data, into another file? Please, check the resulting file to make sure no confidential data rows are included (feel free to delete them if there are). Just in case, perhaps you could PM the contents of the file, to be sure no confidential data slip into public?
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

I ran the query exactly as you posted above.
This is the result:

#1064 - 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 'LIMIT 0, 30' at line 2

SELECT *
FROM drupal_variable
WHERE name LIKE 'forum';

LIMIT 0 , 30

Norv

No... it seems you had a "LIMIT 0, 30" text remaining there, in the SQL code textarea. :)
Please run only with the query above in the box.
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

Nao 尚

I think phpMyAdmin automatically adds the LIMIT thing, and probably doesn't remove the final semi-colon before that.
The solution is of course to remove the semi-colon.
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

@Norv i only ran the query in the code box as you said. There was/is no other text in the query box.

I removed the semi-colon as Nao suggested, and here is the result (no error this time):

MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0004 sec )

SELECT *
FROM drupal_variable
WHERE name LIKE 'forum'
LIMIT 0 , 30

ThorstenE

The converter is currently for drupal "forum" posts only, not for the normal drupal content (articles). That's why there wasn't converted anything.

sharks

So... Do i have to convert all my Drupal "story" type posts into "forum" type posts? Is there any easy way to do that? Right now i have over 4000 posts of the "story" type. In this situation, isn't it easier to modify a few lines in the converter to handle story types instead of forum types?

Norv

Perhaps it would be a good idea if you could try the second suggestion, making an export with the table drupal_variable, both structure and data. If you wish, you could PM it to me..., unless perhaps Nao could take a look at it.
(I will be offline for at least 14 hours soon.)
If you don't feel comfortable with doing so, that is okay, too, we can also look at a drupal installation, and see what is going on in that table. Not sure when, currently I don't have a local installation, nor database, at hand.
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

Oskar Calvo

Hello.

I'm trying to move a Drupal forum to smf, and I have a problem, it tell me that there is a problem with one of the drupal user id (drupal uid are key  and autoincrement), it toll me this:
Duplicate entry '11987' for key 'PRIMARY'
I'm looking around it to understand why it toll me that, and I don't find what happens with the conversion to find a problem with this.

Thanks

Oskar

sharks

LMAO. Unfortunately, Oskar, i have been waiting for someone to fix that Drupal coverter since ages!!

Wise advice: Give up now and save yourself the sorrow of knowing you're alone in this.

ThorstenE

Oskar, have you tried to re-start the conversion from the beginning? If you still got the same error edit drupal_to_smf.sql and find:
---* {$to_prefix}members
Add after:
---{
$ignore = true;
---}

then restart the conversion.

sharks,
sorry to hear that but as I said before: I wrote the converter initially for a drupal forum conversion, not for an article conversion.

Since I'm no longer a member of the SMF team I have no intentions to rewrite my converters or create new ones.. Maybe someone from the current team members is able to help you.

Nao 尚

Quote from: TE on July 06, 2010, 01:58:51 PM
Since I'm no longer a member of the SMF team I have no intentions to rewrite my converters or create new ones.. Maybe someone from the current team members is able to help you.
I personally have no interest in converters. The only one I could possibly work on is a WordPress converter, and possibly a MovableType converter, but even then, I'd need to have a reason to import one of these blogs (i.e., someone wants to move their blog to noisen and I find it a good challenge to implement.)
sharks, I think I asked you something on a WP topic and you didn't reply. (From memory.)
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

Quote from: Nao on July 06, 2010, 05:10:52 PM
sharks, I think I asked you something on a WP topic and you didn't reply. (From memory.)

Eh? I don't think that was a question from your other post. :D But i'll reply to it.

Oskar Calvo

Hello Folks, As I'm a Drupal Developer, I'm building a module to move from Drupal to smf using the drupal apis, it's easy for my.

I hope to finish it, and have a 6.x version soon.

Oskar

sharks

Quote from: Oskar Calvo on July 07, 2010, 06:39:16 AM
Hello Folks, As I'm a Drupal Developer, I'm building a module to move from Drupal to smf using the drupal apis, it's easy for my.

I hope to finish it, and have a 6.x version soon.

Oskar

Thanks a lot for your endeavor and commitment, Oskar.

We all look forward to seeing your new project. :)

BTW, could you build your module so that it's compatible with SMF 1.1 primarily. I mean, compatibility with SMF 2.0 would also be good, but SMF 1.1 is the stable version, so it is preferred.

Advertisement: