17.2. レルムをディレクトリーにエクスポートする
レルムをエクスポートするには、export
コマンドを使用します。このコマンドを呼び出すときに、Red Hat build of Keycloak サーバーインスタンスを開始しないでください。
bin/kc.[sh|bat] export --help
bin/kc.[sh|bat] export --help
レルムをディレクトリーにエクスポートするには、--dir <dir>
オプションを使用できます。
bin/kc.[sh|bat] export --dir <dir>
bin/kc.[sh|bat] export --dir <dir>
レルムをディレクトリーにエクスポートすると、サーバーはエクスポートされるレルムごとに個別のファイルを作成します。
17.2.1. ユーザーのエクスポート方法を設定する
--users <strategy>
オプションを設定することで、ユーザーのエクスポート方法も設定できます。このオプションで使用できる値は次のとおりです。
-
Different_files:
--users-per-file
で設定されたファイルあたりの最大ユーザー数に応じて、ユーザーは異なる json ファイルにエクスポートされます。これはデフォルト値です。 - skip: ユーザーのエクスポートをスキップします。
- realm_file: ユーザーはレルム設定と同じファイルにエクスポートされます。"foo" という名前のレルムの場合、レルムデータとユーザーを含む "foo-realm.json" になります。
- same_file: すべてのユーザーが 1 つの明示的なファイルにエクスポートされます。したがって、1 つのレルムに対して 2 つの json ファイル (レルムデータを含むファイルとユーザーを含むファイルを 1 つずつ) を取得することになります。
different_files
ストラテジーを使用してユーザーをエクスポートしている場合は、--users-per-file
オプションを設定することで、ファイルごとに必要なユーザー数を設定できます。デフォルト値は 50
です。
bin/kc.[sh|bat] export --dir <dir> --users different_files --users-per-file 100
bin/kc.[sh|bat] export --dir <dir> --users different_files --users-per-file 100