How to migrate existing data from H2 to MySQL?

Hi,
the kc server was initially set up using the default h2-db. Now we want to move the data into a MySQL-db. There are several posts about how to change the db as such used by keycloak from h2 to MySQL.
But I haven’t found detailed instructions how to MIGRATE the data from one system to the other. Does a simple export/import work?

Any help is greatly appreciated.

Hi pixi,

yes, export/import works nicely
(full export and full import)

Tried the “Export/Partial Export” via the Web-GUI. No users are exported. And I see “secret”: “**********”,.

How do I export the full data set?

Hi pixi,
There is whole chapter in Server Admin Guide:
https://www.keycloak.org/docs/latest/server_admin/#_export_import

If you can’t stop your instance (or won’t) add -Djboss.socket.binding.port-offset=111 to the export command (it basically starts new instance with same config but on ports shifted for 111)

See: Getting started with Keycloak - Export and Import