ralli / migrate_from_bugzilla

bugzilla to redmine migration rake task
15 stars 14 forks source link

Import uses previously assigned primary key for admin user #1

Closed kastork closed 14 years ago

kastork commented 14 years ago

Redmine 0.9.2

I've created a fresh Redmine install and run the default data loader. Additionally, I've visited the Redmine site and logged in as the admin user. This prompts again for default data loading, which I permitted.

I then run the migration and get

Migrating profilesrake aborted!
Mysql::Error: Duplicate entry '1' for key 1: INSERT INTO `users` (`created_on`, `hashed_password`, `admin`, `language`, `lastname`, `mail`, `updated_on`, `id`, `type`, `firstname`, `mail_notification`, `login`, `status`, `identity_url`, `last_login_on`, `auth_source_id`) VALUES( <omitted>)

The problem is that the default admin user has primary key 1.

Now I've gotten it to work by going through and adding 1 to all the places where a user id is set in the new database. Things look okay, but it doesn't seem like a good long term solution. You can see the changes in my fork of the project.

ralli commented 14 years ago

i used your patch as a basis to fix that bug. there have been a few places left, where the user-id had to be adapted. Hope the import works now ...

Thanks

Ralph