Hi,

we've been using phpbbforum module to integrate phpbb with drupal so we already have most of our users imported to drupal side.
Seems like this module ignore already existing users so most of migrated posts/topics have same author (drupal uid 1).

CommentFileSizeAuthor
#9 1446784.patch1.96 KBJeremyFrench

Comments

darksnow’s picture

I'm not sure how to go about fixing this.

This module uses the migrate framework, which builds map tables to allow automatic mapping of source and destination UIDs. Since the import of phpbb users is a prerequisite of importing any content, it needs to be done.

If you've already got all the users in place, there's no way for this module to tell which UID in phpbb maps too the corresponding user ID in Drupal. I suspect this will need to be handled as a special case for users, taking into account how the bridge module works and mapping the users accordingly.

nozies’s picture

Yup, I made little script to map existing uids to migrate database before migrating topics / posts. Something like:

http://pastebin.com/0E210H6J

phreadom’s picture

Could you give some more info as to where this should be patched in?

At the top of phpbb2drupal_core.inc ?

I was using the phpbbforum module previously, so all 50,000+ of our users are duplicated in the drupal and phpbb user tables, so this ability appears to be an absolute necessity for our migration.

Thank you.

nozies’s picture

It's "standalone" script so it doesn't need anything to work. Just insert correct database informations to db() function and execute the script.

phreadom’s picture

Looks like this is going to be a little trickier than I thought...

The script assumes the phpbb_ prefix on the tables, and apparently assumes that all the tables are in the same database. So either I'll need to rewrite the script a bit to connect to the two databases properly, or juggle the tables.

(Since the phpbb2drupal module doesn't correctly handle table prefixes apparently, I had stripped them and put the phpbb data in its own db with no table prefixes.)

I think I'll attempt the first route... connecting to the correct databases.

phreadom’s picture

Well, after modifying the script to talk to the correct databases, and adjusting the table names to reflect my lack of table prefixes... and after having to work around scripts timing out, then running out of memory, I finally got the mapping imported.

One problem with this is that if you then do a Roll Back on the import process, it wipes out all the usernames that were duplicated between user tables. So where before I was working with my admin account on the drupal side (not the main admin, just my normal user with admin privileges), suddenly I couldn't because my account was deleted.

I'm not sure how to work around this issue, but it wasn't very pleasant to suddenly find myself logged out and looking at a "page not found" error to boot... just something to note. :)

Time to restore from backup and try again. Thanks for the script and feedback! :D

phreadom’s picture

Oh, and I should probably note that not only did it wipe out all the regular user accounts, but specifically wiped out the main site admin (first user/super admin) account too (because the same account name existed on the forum). So basically every user above 0/anonymous is gone.

I can't even log in as the "super admin" because it deleted that too.

And apparently it has deleted ALL the site content associated with any of those user accounts, which means that all of the thousands of articles created by the super admin and other admins, and almost every user are all deleted... which is why my front page is gone. Even though these had nothing to do with the forum import.

And it deleted almost all of the menu items in my suckerfish menu etc... it really just nuked almost the entire site by just trying to roll back the forum related imports. :(

JeremyFrench’s picture

I have something which covers this in a custom branch of the code. It tries to load a user with the same email address before saving. I'll try to get a patch together for it.

JeremyFrench’s picture

Status: Active » Needs review
StatusFileSize
new1.96 KB

This may solve some of the problems. It matches old users if they exsist and it generates new usernames if there are conflicts with those.

Does this help you?

JeremyFrench’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Fixed

Have committed this to the 7.x-3 branch.

nozies’s picture

I don't think it works in this case since existing users have exactly same details on drupal side (even passwords) so it'll just duplicate existing users with different usernames.

JeremyFrench’s picture

It should detect details where emails match and use the existing user for references. If this isn't what you are experiencing with 7.x-3.x then please let me know.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

JeremyFrench’s picture

One problem with this is that if you then do a Roll Back on the import process, it wipes out all the usernames that were duplicated between user tables.

This particular issue has now been fixed in the 7.x-3.x branch. Using migrate 2.5 rollback options.

JeremyFrench’s picture

Issue summary: View changes

typos