外部ディレクトリから Jira 内部ディレクトリへの移行

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

ご使用の Jira サイトが現在ユーザー管理に LDAP または Crows アプリケーションを使用している場合、以下の説明に従って内部ユーザー管理に戻すことができます。Jira インスタンスに少数のユーザーしかいない場合、手動で Jira にユーザーとグループを再作成するほうが簡単です。ユーザーとグループの数が多い場合は、関連するユーザーとグループを Jira 内部ディレクトリに移行するほうが効率的です。

All the options provided below will reset the affected users' passwords. When done, be sure to notify them to use the 'Reset My Password' link on the Jira log in page before they attempt to log in.

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く



オプション 1 – 手動でユーザーとグループを Jira に再作成する

少数のユーザーとグループしかない場合に、このオプションを使用します。

  1. Jira にシステム管理者としてログインします。
  2. ユーザー ディレクトリの管理画面に進み、[順序] 列の矢印をクリックして、ディレクトリの一覧の先頭に内部ディレクトリを移動します。
  3. アプリケーション アクセスに、内部ディレクトリのユーザーが 1 人以上いることを確認します。
    1. アプリケーション アクセスを提供しているグループは、[管理] > [アプリケーション] > [アプリケーション アクセス] で確認できます。
  4. 内部ディレクトリに、Jira システム管理者権限を持つユーザー名 ([管理] > [システム] > [グローバル権限]) が存在することを確認します。 
    • このようなユーザーがいない場合、新しくユーザーを追加し、Jira からログアウトします。
    • 追加したユーザーとしてログインし直し、ユーザー ディレクトリ管理画面に戻ります。
  5. [外部ディレクトリ] ディレクトリを無効化します。
  6. 必要なユーザーとグループを Jira に手動で作成します。内部ディレクトリをディレクトリ一覧の先頭に移動したため、これらのユーザーとグループは内部ディレクトリに追加されます。
    • LDAP または外部ディレクトリに存在するグループに Jira 権限を割り当てた場合、Jira 内に同じ名前のグループを作成する必要があります。
    • LADP に存在するユーザーが Jira 内でコンテンツを作成したか、Jira 内で権限を割り当てられている場合、そのユーザーを Jira で作成する必要もあります。
  7. ユーザーを目的のグループに追加します。

Option 2 – Third-Party App

The App User Management for Jira provides additional user managements features, such as the ability to migrate users from external to internal directory.
Depending on the size of your instance and considering the database manipulation risk, it might be a better approach.


オプション 3 – LDAP/Crowd アプリケーションのユーザーとグループを Jira データベースに転送する


(warning)This should be used as a last resort only when the previous options are not viable. This method is not supported. The Atlassian Support team won't be able to assist you with this process.

この方法をテスト環境で試し、本番環境に変更をデプロイすることを決定する前にデータベースのフル バックアップを行うことを強くお勧めします。

User content is associated through the app_user:user_key value, so the user's content should remain associated with them after the changes below. The app_user on its hand is associated back with the cwd_user table through the lower_user_name value.

There are apps on our marketplace that ease the migration of users between directories, without you requiring to perform the complex workaround below. We suggest that you evaluate these apps before proceeding with the option below.

外部ユーザー ディレクトリ (LDAP または Crowd アプリケーション) ユーザーを Jira データベースに移行するためにこのオプションを使用します。このタスクを実行するには、SQL の知識が必要です。

以下に示す SQL コマンドは、MySQL 用に調整されています。MySQL 以外のデータベースを使用している場合、この SQL を変更してご使用のデータベースで作業する必要があります。

Steps to transfer LDAP/Crowd users to internal directory

手順 1. バックアップの作成

データベースの変更を行う前にデータベースのバックアップを作成するようにします。

  1. From Jira, create a XML backup site backup.
  2. Jira を停止します。
  3. ご利用のデータベース管理ツールで、Jira データベースのデータベース バックアップを作成します。

ステップ 2. Jira ユーザー管理の置き換え

Use the SQL below to move groups and users from your External User Directory to Jira by transferring table content. The SQL provided is specific to MySQL and must be modified for other databases.

ディレクトリの ID の検索

  1. 次のクエリを実行し、ディレクトリの ID を記録します。これは以降の手順で、<Jira Internal DirectoryID> として参照されます。

    select * from cwd_directory where directory_name = 'Jira Internal Directory' or directory_name = '<LDAP Directory Name>'
    

    (info) Take note of the internal directory ID and the external directory ID you will be migrating from.

複数のディレクトリで同じグループに所属している重複ユーザーを検索して削除する

以降の手順で重複が発生しないようにするため、Jira にグループを移動するときに次の SQL を使用して、外部ディレクトリと内部ディレクトリの両方で同じ名前のグループに所属しているユーザーを検索します。 

  1. 異なるディレクトリで同じグループに所属している、同じ名前のユーザーを検索するには、以下のコマンドを実行します。

    SELECT count(*), a.user_name, c.group_name from cwd_user a
    join cwd_membership b on b.child_id = a.id
    join cwd_group c on c.id = b.parent_id group by 2,3 having count(*)>1

    返されたユーザー名とグループをそれぞれ記録しておきます。これは次の手順で必要となります。 

  2. 外部ディレクトリで、それぞれのグループからユーザーを削除します。メンバーシップは Jira 内部ディレクトリに残ります。 
  3. 上記の SQL を再度実行します。結果が返されなければ、次の手順に移動できます。 

グループを Jira に移動する

  1. 内部ディレクトリ内に外部ディレクトリのグループと同じ名前のグループが複数存在する場合があります。これらを見つけるには、次のコマンドを実行します。

    select distinct a.id, a.directory_id, a.group_name, d.directory_name from cwd_group a join cwd_group b on a.group_name=b.group_name join cwd_directory d on d.id=a.directory_id where a.directory_id != b.directory_id;
    


    1. 前のクエリで結果が返されている場合、重複する各グループ名について、Jira 内部ディレクトリでのそのグループの ID (<internal group id>) と外部ディレクトリでの ID (<external group id>) を見つけます。以下を実行します。

      update cwd_group_attributes set group_id=<internal group id>, directory_id=<Internal Directory ID> where group_id=<External Group ID>;
      update cwd_membership set child_id=<Internal Group ID> where child_id=<External Group ID>;
      update cwd_membership set parent_id=<Internal Group ID> where parent_id=<External Group ID>;
      delete from cwd_group where id=<External Group ID>;
      
  2. 外部ディレクトリ内のすべてのグループを Jira 内部ディレクトリに移動します。

    update cwd_group set directory_id=<Internal Directory ID> where directory_id=<External Directory ID>;
    update cwd_membership set directory_id=<Internal Directory ID> where directory_id=<External Directory ID>;
    

ユーザーを Jira 内部ディレクトリに移動

  1. 内部ディレクトリ内に外部アプリケーションのユーザーと同じ名前のユーザーが複数存在する場合があります。これらを見つけるには、次のコマンドを実行します。

    select distinct a.id, a.directory_id, a.user_name, d.directory_name from cwd_user a join cwd_user b on a.user_name=b.user_name join cwd_directory d on d.id=a.directory_id where a.directory_id != b.directory_id;
    


    1. 前のクエリで結果が返されている場合、重複する各ユーザー名について、Jira 内部ディレクトリでのそのユーザーの ID (<internal user id>) と外部アプリケーションでの ID (<external user id>) を見つけます。以下を実行します。

      update cwd_membership set child_id=<Internal User ID> where child_id=<External User ID>;
      update cwd_user_attributes set user_id=<Internal User ID>, directory_id=<Jira Internal ID> where user_id=<External User ID>;
      delete from cwd_user where id=<External User ID>;
      
  2. 外部アプリケーション内のすべてのユーザーを Jira 内部ディレクトリに移動します。

    update cwd_user set directory_id=<Internal Directory ID> where directory_id=<External Directory ID>;
    

外部アプリケーション ディレクトリの削除

  1. 内部ディレクトリが一番上に来るようにディレクトリの順番を変更し、内部ディレクトリをアクティブ化する必要があります。
    1. ディレクトリが内部ディレクトリと、削除しようとしている外部ディレクトリの 2 つのみの場合、以下を実行します。

      update cwd_directory set directory_position = 0 where id = <Internal Directory ID>;
      
    2. 3 つ以上のディレクトリがある場合、一番上が内部ディレクトリ (directory_position0)、一番下が削除しようとしている外部アプリケーション ディレクトリになるように並べ替える必要があります。
      • 以下のコマンドを使用して、ディレクトリとその順序を表示します。

        select * from cwd_directory order by directory_position;
        
      • 必要な順序になるようにリストの順序を変更します。ディレクトリの順序は次のコマンドを使用して変更できます。

        update cwd_directory set directory_position = <position> where directory_id = <directory id>;
        
    3. 内部ディレクトリが有効であることを確認します。
      • List the internal directory. An enabled directory will have its 'active' column set to '1'

        select id, directory_name, active from cwd_directory where id = <Internal Directory ID>;
        
      • 内部ディレクトリがアクティブでない場合、次のようにしてアクティブ化します。

        update cwd_directory set active = '1' where id = <Internal Directory ID>;
        
  2. ディレクトリが正しい順序で配列されたら、外部アプリケーション ディレクトリをディレクトリの順序から削除します。


    1. 外部アプリケーション ディレクトリはデータベース内の他の複数の表で参照されています。このディレクトリへの残りの参照を削除する必要があります。

      delete from cwd_directory_attribute where directory_id=<External Directory ID>;
      delete from cwd_directory_operation where directory_id=<External Directory ID>;
      
    2. 外部ディレクトリへのすべての参照を削除したら、以下を使用してディレクトリを削除します。

      delete from cwd_directory where id = <External Directory ID>;
      

パスワードのリセット

All users who were in the External Directory you deleted, including admins, will be unable to log in. Their passwords need to be reset by choosing the 'Forgot your password?' link on the login page. 
Alternatively, you can run the following database update to reset users password to 'sphere'


update cwd_user set credential='uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where lower_user_name in ('user1', 'user2', 'user3')
最終更新日: 2024 年 2 月 27 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.