# Realm Import - Service Account Roles Missing

**URL:** <https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870>\
**Category:** Configuring the server\
**Created:** [May 21, 2020, 10:20am UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870 "2020-05-21T10:20:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiago.diogo](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@tiago.diogo](https://forum.keycloak.org/u/tiago.diogo)\
**Post date:** [May 21, 2020, 10:20am UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/1 "2020-05-21T10:20:34Z")

</div>

hello there,

in order to have fully automated docker development environment, our team deployment of keycloak does the realm import everytime the container gets up. no problems there.  
unfortunately something that is never applied to the realm are the client service account roles, we always have to add them manually eventhough they exists in the users exported file.  
everything else, including clients, secrets, users, … gets imported.  
is there a known limitation on this part of the import?

any help is much appreciated

Our export configurations:  
-Dkeycloak.migration.action=export  
-Dkeycloak.migration.provider=dir  
-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config  
-Dkeycloak.migration.usersExportStrategy=SAME\_FILE  
-Dkeycloak.migration.realmName=my-realm  
-Djboss.socket.binding.port-offset=1

Our import configurations:  
‘-Dkeycloak.migration.action=import’,  
‘-Dkeycloak.migration.provider=dir’,  
‘-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config’,  
‘-Dkeycloak.migration.strategy=OVERWRITE\_EXISTING’,

---

<div class="post-metadata">

**Author:** ![joao-rebelo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/joao-rebelo/32/3487_2.png) [@joao-rebelo](https://forum.keycloak.org/u/joao-rebelo)\
**Post date:** [May 21, 2020, 3:02pm UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/2 "2020-05-21T15:02:11Z")

</div>

I’m on the same problem since Keycloak 7… I believe some import bugs have been fixed, but this one still remains.  
Hope this can be fixed eventually

---

<div class="post-metadata">

**Author:** ![tiago.diogo](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@tiago.diogo](https://forum.keycloak.org/u/tiago.diogo)\
**Post date:** [May 29, 2020, 1:13pm UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/3 "2020-05-29T13:13:01Z")

</div>

do you know if there is an issue open for this situation that we can link to this thread?  
if not i will create a new one on the red hat tracker…

---

<div class="post-metadata">

**Author:** ![joao-rebelo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/joao-rebelo/32/3487_2.png) [@joao-rebelo](https://forum.keycloak.org/u/joao-rebelo)\
**Post date:** [June 3, 2020, 1:52pm UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/4 "2020-06-03T13:52:48Z")

</div>

Hi,

I believe its this issue: [https://issues.redhat.com/browse/KEYCLOAK-13823](https://issues.redhat.com/browse/KEYCLOAK-13823)  
Hopefully to be resolved by Keycloak 11.

Regards  
João

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [June 3, 2020, 2:06pm UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/5 "2020-06-03T14:06:05Z")

</div>

I saw an update today that 10.0.2 was released but sad to see it’s not included.  
The fix has been merged almost a month ago in the master branch so I don’t understand why they didn’t include it.

---

<div class="post-metadata">

**Author:** ![maquineh](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/maquineh/32/1388_2.png) [@maquineh](https://forum.keycloak.org/u/maquineh)\
**Post date:** [September 16, 2020, 9:34pm UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/6 "2020-09-16T21:34:19Z")

</div>

Keycloak 11.0.0 i cant import client roles

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [September 17, 2020, 6:16am UTC](https://forum.keycloak.org/t/realm-import-service-account-roles-missing/2870/7 "2020-09-17T06:16:44Z")

</div>

try 11.0.2 and see if that solves your problem.
