I added the integration code for location_user
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | migrate_extras_location_user_integration-753048.patch | 3.27 KB | frankcarey |
I added the integration code for location_user
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | migrate_extras_location_user_integration-753048.patch | 3.27 KB | frankcarey |
Comments
Comment #1
frankcarey commentedhere is is. It adds the location_user.migrate.inc file. This code basically includes the location.migrate.inc code and reuses it as much as possible. Please test and I'll add it to the dev.
Comment #2
j0k3z commentedIs this included in the dev snapshot now?
Comment #3
frankcarey commentedIt will allow you to import user locations, yes. It is not as of right now in the dev snapshot.
Comment #4
j0k3z commentedIs there any documentation about how to do this? How do you export the users from the first site before you import them with this?
Comment #5
j0k3z commentedAlso, which file do we patch with this? I dont have a file called migrate_extras_location_user_integration or anything similar
Comment #6
j0k3z commentedI would be more then happy to review this code if you can help me get it working.
I was able to patch the module file and uploaded the new files created. Now how do I actually move the users between the Drupal websites? Does this only import and I need something else to export the users first?
Comment #7
frankcarey commentedYou first need to import the users in the normal migrate fashion. Then you need to import the user locations as a separate content set. It is important that you use the user ID of the imported user (not the old ID). You can do that by adding the migrate user map relationship in the view so that you have old IDs and new IDs in the same view. When you create the content set, you use the destid of the user (the new user id) as the key for the UID field.
Comment #8
dpatte commentedThank you for your work on this.
I am using Migrate 1.0 & Table Wizard 1.1
I am trying to import users (with location data) into a new drupal site.
I have successfully migrated the users first, as explained, and this produced a mapping table of ids.
The next step would be to build a relationship between that map table and my original user data from the old site.
I have tried relating the user mapping source id (as base) with the userid in the original table
I have also tried relating the userid of the original table (as base) with the source id in the user mapping table.
Both methods give me errors - it tries to read the system table from the old (non drupal) database instead of the default - and fails.
Am I missing something, or am I ahead of the releases in what I am looking for? Is there an alpha/beta/dev of the above modules that I should be trying instead?
Also, in the mean time, i looked at migrate, and even after the location_user patches included, it doesnt show location_user as a destination option. For your patch, what destination type am I supposed to select?
Thanks alot.
Comment #9
dpatte commentedhi frank
I am still hoping to migrate my location data from an old script into a new site, as mentioned above, and Im looking forward to using your .inc file. Do I have to use the dev version of migrate extras? Do you have any further advice to help me along?
Thanks
Comment #10
frankcarey commentedI'm going to have to write some documentation I see about the patch i made to join across databases with views.
Comment #11
frankcarey commentedCommitted to dev.
@dpatte: Read #7, but it sounds like you get the idea. If you are trying to join tables that are in different databases (location data in an external (not the default db) table to a migrate_*_map table), you'll need to patch views so that views can handle this edge case. The patch is in #576694: Enable views to handle external tables properly, allowing for joins across tables in different mysql databases . Use the patch from comment #17. Then use table wizard (it was in tw-1.x-dev, but i think that it made it into the release version) to setup the relationship between the two tables. Note that the tables have to be accessible by the same mysql user as your default database, and they have to be mysql. See the ticket for more info on that.
All this is not needed if you use prefixing or some other way to get your import-from tables and your drupal tables in the same database. For us that was a big PITA, so I created the views patch so they can live happily apart in their own db.
Comment #12
frankcarey commentedComment #13
dpatte commentedThanks Frank
I notice that #576694 is to be applied against views 1.7. Im currently using views 1.10. I assume the patch wont work for 1.10 except if applied manually.
I'll patch then try it against TW
1.11.2 and get back to you.Comment #14
frankcarey commentedI think tw has the patch already (look for a reference to views_clean_alias() in the code)
Comment #16
dpatte commentedHi again
I'm still a little stuck.
I would like to imprt the user locations as core user locations, not CCK locations. I assume this is what I can do.
I have all the users in, but now need to imprt the locations. Are these the correct steps?
- create a new view that uses adds the destin-userid as a relationship.
- create a new content set in migrate that uses destin node location and the destin id of the user as the key
Is this correct?
Comment #17
dpatte commentedOk. The users are imported.
I then created a relationship through tablewizrd, and this seems to work since the view of my old table now has both the original and imported userids.
But Migrate seems to have a problem.
>> EDIT: Simply by visiting the Migrate page,
I now get the following error
user warning: Table 'relativ2_wbst1.migrate_map_phpws_users' doesn't exist query: SELECT COUNT(*) FROM (SELECT mod_users.user_id AS user_id FROM mod_users mod_users LEFT JOIN migrate_map_phpws_users migrate_map_phpws_users ON mod_users.user_id = migrate_map_phpws_users.sourceid ) count_alias in /home/relativ2/public_html/new/sites/all/modules/views/includes/view.inc on line 745.
wbst1 is my old datebase, but migrate_map is in my new database
Am I missing a patch in migrate?
Im using all the latest modules including migrate extras 1-0-beta 1, and have hand patched the latest views to do the reverse explode and clean functionality.
>> I have tried the dev of both migrate and migrate extras, and no luck yet.
Comment #18
lobo235 commentedFrank, It looks like it's been a while since you last worked on this code but I hope that you might be able to help me with this issue. I have the latest migrate_extras-6.x-1.x-dev which appears to have your patch in it.
I am trying to get a location imported for each of the users that I have already imported into my drupal system. I have done as described in #7 and I have a migrate user map table that lists the old userid from the old db and the new uid. I have created a view that contains all the location data as well as the sourceid and destid from the migrate user map table. I only see a Migrate Destination of Location and not one for User Location. In the Location Destination I don't see a way to add a location to a specific uid.
I keep getting stuck on this one point. Can you provide any assistance to me to figure out how to add the locations to my users?
Thanks!
Comment #19
FrequenceBanane commentedsubscribe
Comment #20
mikeryanMigrate and Migrate Extras V1 are no longer supported. Location support for V2 is now consolidated to the following issue:
#943178: Implementation of Location support for Migrate Extras V2