Hi

First I would like to thank the devs and supporters of this project. Great work. Tried different approaches, but this seems to be the most feature-rich of them all.

I have a small issue when importing users from a php-fusion6_user_table into drupal - I simply cannot figure out how to keep the uid? ... Drupal automatically gives the imported users a new uid.

A small tip on how to keep the uid, would be a tremendous help, as I'm going a little brain-fried trying to accomplish this.

Thank you for your time.

Comments

moshe weitzman’s picture

Status: Active » Fixed

I managed to get this feature into Drupal 7 core. For Drupal 6, you have to backport the patch at #303965: Enhanced data import - node_save() and user_save()

FAF’s picture

Thank you for your reply, I will backport the patch and try to see how it turns out.

"I managed to get this feature into Drupal 7 core" - wow, nice. Really looks forward to test D7.

Thank you again.

Status: Fixed » Closed (fixed)

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

koyama’s picture

FAF, can you say whether you were successful backporting the patch to Drupal 6?

I guess this step is critical to anyone who wants to migrate users and nodes into Drupal 6 when you want to preserve author information, right?

mikeryan’s picture

The patch Moshe points to is the one backported to Drupal 6 - we are using this successfully in our current project.

It is not necessary to preserve the IDs from the old system in order to preserve author information - migrating your users fills in a mapping of old IDs to Drupal uids, and you can incorporate this map into your node content set view so the correct uids are saved to the node records.

Fidelix’s picture

Version: 6.x-1.x-dev » 7.x-2.1-beta1

I need this on Drupal 7 because my site will be integrated with OpenAtrium and some external tools, which need the legacy UIDs to be preserved.

Please, can someone tell me how to achieve this?

Fidelix’s picture

Status: Closed (fixed) » Active

Please, help.
Can someone give me an example of how to do this?

bmacdonald’s picture

Take a look at or around lines 293-310 of the migrate example file `beer.inc` for a couple of suggestions for maintaining node identities between old and new systems. You can either map the `nid` to the old unique ID or you can specify a `sourceMigration` when you set up the relevant `addFieldMapping` method.

mikeryan’s picture

Component: Miscellaneous » Code
Status: Active » Closed (fixed)

Please don't piggy-back on long-closed issues. New feature request opened at #1218244: Support is_new for users in D7 - in the meantime, just add

$this->addFieldMapping('is_new')
    ->defaultValue(TRUE);
$this->addFieldMapping('uid', 'id_to_preserve');