# Export realm and user data

**URL:** <https://forum.keycloak.org/t/export-realm-and-user-data/13265>\
**Category:** Getting advice\
**Created:** [January 24, 2022, 9:03pm UTC](https://forum.keycloak.org/t/export-realm-and-user-data/13265 "2022-01-24T21:03:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjames1](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@cjames1](https://forum.keycloak.org/u/cjames1)\
**Post date:** [January 24, 2022, 9:03pm UTC](https://forum.keycloak.org/t/export-realm-and-user-data/13265/1 "2022-01-24T21:03:19Z")

</div>

Hi, We are currently on KeyCloak v8.02 installed as a windows service using Oracle provider and we are going to upgrade to KeyCloak v16 using PostgreSQL. Currently I am trying to export the realm and users data by using the below command.

sh standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=keycloak-export.json -Djboss.http.port=8888 -Djboss.https.port=9999 -Djboss.management.http.port=7777

We have three realms and the data that is being exported just have the master realm data (not even the master users data). Can someone please help me figure out whats happening and how we can export and import the data while migrating to another version

---

<div class="post-metadata">

**Author:** ![rafidamr](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rafidamr](https://forum.keycloak.org/u/rafidamr)\
**Post date:** [November 17, 2022, 11:49am UTC](https://forum.keycloak.org/t/export-realm-and-user-data/13265/2 "2022-11-17T11:49:08Z")

</div>

Please try this step

1. dump the database using native Oracle functionality into a .sql file
2. import the .sql into PostgreSQL db directly

---

<div class="post-metadata">

**Author:** ![girish](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/girish/32/7062_2.png) [@girish](https://forum.keycloak.org/u/girish)\
**Post date:** [November 30, 2022, 10:53am UTC](https://forum.keycloak.org/t/export-realm-and-user-data/13265/3 "2022-11-30T10:53:24Z")

</div>

yes keycloak had that mentioned in documentation.
