# How to implement user's migration

**URL:** <https://forum.keycloak.org/t/how-to-implement-users-migration/17433>\
**Category:** Getting advice\
**Created:** [September 15, 2022, 3:22pm UTC](https://forum.keycloak.org/t/how-to-implement-users-migration/17433 "2022-09-15T15:22:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![discourse](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/discourse/32/6574_2.png) [@discourse](https://forum.keycloak.org/u/discourse)\
**Post date:** [September 15, 2022, 3:22pm UTC](https://forum.keycloak.org/t/how-to-implement-users-migration/17433/1 "2022-09-15T15:22:44Z")

</div>

Hello !

I have existing users and their password hashes in the web application, stored in a DB.  
I would like to migrate them into Keycloak - seamlessly.  
It means that I’d connect my site to Keycloak using OpenID. Existing users then get redirected to Keycloak login and they do so using their **existing** password.  
The password hash is then stored in Keycloak and on the consecutive login, this one is checked.

How would you approach it? Should I create a new plugin (provider)?  
I could pre-create the users in Keycloak if needed.

I’ve found some related development on github:

> **[GitHub - daniel-frak/keycloak-user-migration: A Keycloak plugin for migrating...](https://github.com/daniel-frak/keycloak-user-migration)**
>
> A Keycloak plugin for migrating users from legacy systems - GitHub - daniel-frak/keycloak-user-migration: A Keycloak plugin for migrating users from legacy systems

> **[GitHub - BeeInventor/keycloak-cognito-migration: A Keycloak...](https://github.com/BeeInventor/keycloak-cognito-migration)**
>
> A Keycloak UserStorageProvider for migrating users from AWS Cognito - GitHub - BeeInventor/keycloak-cognito-migration: A Keycloak UserStorageProvider for migrating users from AWS Cognito

but I’m not sure about the approach I should take.

---

<div class="post-metadata">

**Author:** ![sdn](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sdn](https://forum.keycloak.org/u/sdn)\
**Post date:** [September 24, 2022, 3:16pm UTC](https://forum.keycloak.org/t/how-to-implement-users-migration/17433/2 "2022-09-24T15:16:41Z")

</div>

Hello! I used User SPI to migrate my legacy users. After successful authentication I saved to keycloak with password.

---

<div class="post-metadata">

**Author:** ![sdn](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sdn](https://forum.keycloak.org/u/sdn)\
**Post date:** [September 24, 2022, 3:20pm UTC](https://forum.keycloak.org/t/how-to-implement-users-migration/17433/3 "2022-09-24T15:20:06Z")

</div>

[https://www.keycloak.org/docs/latest/server\_development/index.html#import-implementation-strategy](https://www.keycloak.org/docs/latest/server_development/index.html#import-implementation-strategy)
