Skip to content

Lazy migration of users to GenAuth

Migration process

GenAuth supports smooth migration of users from a custom database to GenAuth without downtime. When this function is enabled, the following effects will be produced on login and registration requests:

Authentication request:

  • The user will use the custom data script you configured to authenticate the user for the first time. After successful authentication, it will be migrated to the GenAuth database. Otherwise, it will prompt that the user does not exist or the password is incorrect.
  • The user does not need to change the account password.
  • The user's subsequent authentication will go through the GenAuth database.
  • When all users have been successfully authenticated at least once, the database migration is completed smoothly.

Registration request:

  • When registering a user, it will first check whether it exists in the GenAuth database. If it already exists, an error prompt will be returned.
  • If the user does not exist in the GenAuth database, the getUser interface will be used to check whether the user exists in the custom database. If it already exists, an error prompt will be returned.
  • If the user does not exist in both the GenAuth database and the custom database, the registration is successful.

Configuration script

You need to write the Login and Search user scripts in the GenAuth console, Connect to identity source - Custom database page. For details, please see:

  • [Write login script](/en/genauth/guides/database-connection/configuration/#Write database operation script).
  • [Write search user script](/en/genauth/guides/database-connection/configuration/#Write database operation script).

Verify the migration effect

After you enable user data migration, you can verify the fully migrated users in the following ways:

After user migration is complete

After all users have been migrated, close the custom database.

Agent infrastructure for identity, memory, and web action.