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).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1446784.patch | 1.96 KB | JeremyFrench |
Comments
Comment #1
darksnowI'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.
Comment #2
nozies commentedYup, I made little script to map existing uids to migrate database before migrating topics / posts. Something like:
http://pastebin.com/0E210H6J
Comment #3
phreadom commentedCould 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.
Comment #4
nozies commentedIt's "standalone" script so it doesn't need anything to work. Just insert correct database informations to db() function and execute the script.
Comment #5
phreadom commentedLooks 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.
Comment #6
phreadom commentedWell, 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
Comment #7
phreadom commentedOh, 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. :(
Comment #8
JeremyFrench commentedI 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.
Comment #9
JeremyFrench commentedThis 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?
Comment #10
JeremyFrench commentedHave committed this to the 7.x-3 branch.
Comment #11
nozies commentedI 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.
Comment #12
JeremyFrench commentedIt 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.
Comment #14
JeremyFrench commentedThis particular issue has now been fixed in the 7.x-3.x branch. Using migrate 2.5 rollback options.
Comment #14.0
JeremyFrench commentedtypos