GItlab migration

I’m migrating from gitlab to gitea and while I can get most things across nicely, merge/pull requests do not map the gitea users, and keeps the external user. I’ve tried linking gitlab accounts to my gitea accounts, but the imported data still uses the gitlab username. I understood there was an external user id mapping as part of the import. I expected the imported data to link to the gitea user (and have the user name be a link to the user profile as with reviews/comments created in gitea). Is this how the process is supposed to work?

I have also tried dumping the database, manually changing the username to match the gitea one and swap the external user id with the gitea user uid, but that didn’t help with the linking.

Have I missed anything, or I am I expecting too much here?

Thanks,

Simon

This other topic suggests the poster id’s should get migrated, but I do not see this happening

https://forum.gitea.com/t/link-external-account/2278

I’ve done a bit more digging can see there is a case mismatch.

In gitea_uploader.go the remapExternalUser function uses “gitlab” as the service type name. However in my db, the external user has the provider set as “Gitlab” - as the case does not match the mapping is not found.

I think this may be because I originally named the connection Gitlab and then later renamed to gitlab. Unlinking my user and re-linking it creates the lowercase gitlab in the table.

However it seems to be there are a couple of bugs.The remap function is incorrectly using the external_login_user.provider instead of the provider field from the input_source table. The external_login_user.provider either needs updating with the input source, or is redundant due to the login_source_id column.

Simon