{"id":2900,"date":"2023-05-28T09:53:30","date_gmt":"2023-05-28T09:53:30","guid":{"rendered":"https:\/\/puretechnologies.digital\/?p=2900"},"modified":"2023-05-28T10:33:15","modified_gmt":"2023-05-28T10:33:15","slug":"guide-exporting-keycloak-v21-realm-using-command-line-interface-cli-deployed-via-docker","status":"publish","type":"post","link":"https:\/\/puretechnologies.digital\/bg\/guide-exporting-keycloak-v21-realm-using-command-line-interface-cli-deployed-via-docker\/","title":{"rendered":"\u0420\u044a\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e: \u0415\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 Keycloak (v21) realm \u0447\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0435\u043d \u0440\u0435\u0434 (CLI), \u0432\u043d\u0435\u0434\u0440\u0435\u043d (\u0434\u0435\u043f\u043b\u043e\u0439\u043d\u0430\u0442) \u043f\u0440\u0435\u0437 Docker"},"content":{"rendered":"<p class=\"wp-block-paragraph\">\u0412 \u043f\u0440\u0435\u0434\u0438\u0448\u043d\u0430\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u0442\u0430 \u043a\u043e\u043d\u0437\u043e\u043b\u0430 \u043d\u0430 Keycloak \u0432\u043a\u043b\u044e\u0447\u0432\u0430\u0448\u0435 \u043f\u043e\u0434\u0434\u0440\u044a\u0436\u043a\u0430 \u0437\u0430 \u0435\u043a\u0441\u043f\u043e\u0440\u0442 \u043d\u0430 \u0434\u0430\u0434\u0435\u043d realm \u043a\u0430\u0442\u043e JSON \u0444\u0430\u0439\u043b. \u041f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0441\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 (UI) \u043d\u0430 \u0441\u043a\u0440\u0438\u0439\u043d\u0448\u043e\u0442\u0430 \u043f\u043e-\u0434\u043e\u043b\u0443 \u043b\u0438\u043f\u0441\u0432\u0430 \u0432\u044a\u0432 \u0432\u0435\u0440\u0441\u0438\u044f Keycloak 21, \u043f\u043e\u0440\u0430\u0434\u0438 \u043a\u043e\u0435\u0442\u043e \u0442\u0430\u0437\u0438 \u043e\u043f\u0446\u0438\u044f \u0435 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0430\u043d\u0430 \u0438 \u0442\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0441\u0435 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430 \u0430\u043b\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0435\u043d \u043d\u0430\u0447\u0438\u043d \u0437\u0430 \u0435\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 realm.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"501\" src=\"https:\/\/puretechnologies.digital\/wp-content\/uploads\/2023\/05\/image-1024x501.png\" alt=\"\" class=\"wp-image-2901\" srcset=\"https:\/\/puretechnologies.digital\/wp-content\/uploads\/2023\/05\/image-1024x501.png 1024w, https:\/\/puretechnologies.digital\/wp-content\/uploads\/2023\/05\/image-300x147.png 300w, https:\/\/puretechnologies.digital\/wp-content\/uploads\/2023\/05\/image-768x376.png 768w, https:\/\/puretechnologies.digital\/wp-content\/uploads\/2023\/05\/image.png 1299w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u041d\u0443\u0436\u043d\u0438 \u0441\u0442\u044a\u043f\u043a\u0438 \u0437\u0430 \u0435\u043a\u0441\u043f\u043e\u0440\u0442\u0432\u0430\u043d\u0435 \u043d\u0430 Keycloak realm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0445\u043e\u0434 \u0432 Keycloak \u0441 \u043f\u043e\u043c\u043e\u0449\u0442\u0430 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 Docker:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it &lt;container_name&gt; \/bin\/bash<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0432\u0438\u0433\u0438\u0440\u0430\u0439\u0442\u0435 \u0434\u043e \u043f\u0430\u043f\u043a\u0430\u0442\u0430 \u043d\u0430 Keycloak:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/keycloak\/bin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Execute export command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/kc.sh export --file &lt;file-name>.json -Dkeycloak.migration.realmName=&lt;realm-name>\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u043e\u043f\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0444\u0430\u0439\u043b \u043e\u0442 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u044a\u043c \u0445\u043e\u0441\u0442<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430\u0442\u0430 \u0441\u0442\u044a\u043f\u043a\u0430 \u0435 \u0434\u0430 \u0438\u0437\u043f\u044a\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u043a\u043e\u043f\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0444\u0430\u0439\u043b\u0430 \u043e\u0442 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043a\u044a\u043c \u0445\u043e\u0441\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 (\u041e\u0421). \u041e\u0442\u0432\u043e\u0440\u0435\u0442\u0435 \u043d\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0435\u043d \u0440\u0435\u0434 (CLI) \u0438\u043b\u0438 \u0438\u0437\u043b\u0435\u0437\u0442\u0435 \u043e\u0442 Docker \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker cp medapp_keycloak:\/opt\/keycloak\/bin\/&lt;file-name&gt;.json &lt;host-os-path&gt;<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>In previous version Keycloak administration console included a support for json export of a given realm. The UI on the screenshot below is missing from Keycloak version 21, hence there option is disabled and an alternative way to export a realm has to be taken. Steps needed to export Keycloak realm Login in keycloak using&#8230;<\/p>","protected":false},"author":1,"featured_media":2908,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2900","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","nt-post-class","","excerpt-none"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/posts\/2900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/comments?post=2900"}],"version-history":[{"count":4,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/posts\/2900\/revisions"}],"predecessor-version":[{"id":3089,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/posts\/2900\/revisions\/3089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/media\/2908"}],"wp:attachment":[{"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/media?parent=2900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/categories?post=2900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puretechnologies.digital\/bg\/wp-json\/wp\/v2\/tags?post=2900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}