====== Upgrading Keycloak ====== ===== 1. Export realm from existing installation ===== Start your existing ("old") keycloak instance with following parameters: bin/standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=/home/kalaschnikow/Desktop/keycloak.json See also [[https://keycloak.gitbooks.io/server-adminstration-guide/content/topics/export-import.html|official documentation]] ===== 2. Install new Keycloak ===== ==== 2.1 Download and unzip ==== http://www.keycloak.org/downloads.html Note: Downloads don't work in Opera (strange...) - browser crashes. So it will be better to use Firefox. ==== 2.2 Create a DB ==== It is not recommended to use the built-in H2 database, so we should create a MySQL database for keycloak. Start mysql # mysql -u root Then create the DB: create database keycloak2_5_1; Then copy the MySQL module to the keycloak. It should be in the directory:\\ ''$KEYCLOAK_HOME/modules/system/layers/base/com/mysql/jdbc/main'' You can also create this module manually. Here is the [[https://keycloak.gitbooks.io/server-installation-and-configuration/content/topics/database.html|documentation]] about it. After that edit standalone.xml and add to it the follwing lines: jdbc:mysql://localhost:3306/keycloak2_5_1?useUnicode=true&connectionCollation=utf8_general_ci&characterSetResults=utf8&characterEncoding=utf8 mysql root YOURPASSWORD com.mysql.jdbc.Driver com.mysql.jdbc.jdbc2.optional.MysqlXADataSource ==== 2.3 Create realm and import data==== Start your new Keycloak. Create a new realm. Change into it. Import JSON file. Keycloak should import all users and roles. On "Login" tab set "Require SSL" to "None". ==== 2.4 Create clients ==== === 2.4.1 avril-web === Create client 'avril-web'. Important: Web-Origin should contain "http://localhost:8080/*" === 2.4.2 avril-backend === Create client 'avril-backend'. === 2.4.3 avril-third-party === Create client 'avril-third-party'. Valid redirect URIs should contain: org.aerogear.Shoot://oauth2Callback Direct Access Grant Enabled - Off (?). On "Scopes" tab: Assigned roles should contain "user". ===== Misc ===== User ''user_manager'' should be existing in realm ''avril-realm'' and should have role ''admin''.