日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Confluence 6 选项 2 – 转移 Crowd/Jira 应用程序中的用户和用户组到 Co

發布時間:2025/6/16 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Confluence 6 选项 2 – 转移 Crowd/Jira 应用程序中的用户和用户组到 Co 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

當你打算合并的外部目錄服務器(Crowd 或 Jira 應用)有大量的用戶到 Confluence 數據庫中的時候,請使用這個選項。你需要有基本的 SQL 知識才能完成這個任務。

下面的 SQL 命令假設你使用的數據庫為 MySQL 數據庫。如果你使用的數據庫不是 MySQL 數據庫的話,你需要針對你使用的數據庫對你的腳本進行一些修改后才能執行。

第 1 步. 創建備份

創建備份是在你對系統進行操作時候出現錯誤后恢復的唯一辦法。

  • 從 Confluence 中,你可以創建一個完整的 XML 站點備份包括所有的附件。

  • 停止 Confluence。

  • 將你服務器上的? Confluence home 和 安裝目錄中的所有文件和目錄拷貝到系統的其他地方備份。

  • 針對你的外部應用程序,重復上面的步驟。

  • 從你的 MySQL 數據庫管理工具中,為 Crowd/Jira 和 Confluence 都創建一個備份。

  • 第 2 步. 替換 Confluence 用戶管理

    使用下面的 SQL 腳本備份外部應用程序中的用戶和用戶組到 Confluence 表中。下面的腳本是針對 MySQL 數據庫設計運行的,如果你使用其他的數據庫,你需要對腳本進行修改。

    找到你目錄使用的 ID
  • 運行下面的腳本,然后對返回的結果數進行記錄,這個 ID 將會在后面的 <Confluence Internal ID> 參數中引用。

    select id from cwd_directory where directory_name='Confluence Internal Directory';
  • 針對用戶目錄關里界面,找到你希望移動的用戶,用戶組名字。運行下面的腳本,然后對返回的結果數進行記錄,這個 ID 將會在后面的 <External Application ID> 參數中引用。

    select id from cwd_directory where directory_name='<External Directory Name>';
  • 移動用戶組到 Confluence
  • 在你的內部目錄中,外部目錄的名字是相同情況是被允許的,希望找到這些名字,請運行下面的腳本:

    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;
  • 如果上面的腳本有返回插件結果,針對每一條記錄表明的是名字出現了重復,在 Confluence 的內部目錄中找到這些重復名字的 ID(<internal group id>)和外部應用(<external group id>)。運行下面的腳本:

    update cwd_group_attribute set group_id=<internal group id>, directory_id=<Confluence Internal Id> where group_id=<external group id>;update cwd_membership set child_group_id=<internal group id> where child_group_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>;
  • 移動所有外部應用中的所有組到 Confluence 內部目錄中。

    update cwd_group set directory_id=<Confluence Internal ID> where directory_id=<External Application ID>;
  • 移動用戶到 Confluence
  • 在內部目錄中是允許有多個相同的用戶名的,如果這些用戶組在不同的外部應用目錄中的話。找到這些用戶,運行:

    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;
  • 如果上面的腳本返回了多條記錄的話,表明的是你的系統中有多個用戶具有相同的用戶名在不同的外部目錄中。在 Confluence 的內部目錄中找到這些重復名字的 ID((<internal user id>)和外部應用(<external user id>)。運行下面的腳本:

    update cwd_membership set child_user_id=<internal user id> where child_user_id=<external user id>;update cwd_user_credential_record set user_id=<internal user id> where user_id=<external user id>;update cwd_user_attribute set user_id=<internal user id>, directory_id=<Confluence Internal ID> where user_id=<external user id>;delete from cwd_user where id=<external user id>;
  • 移動所有外部應用中的所有用戶到 Confluence 內部目錄中。

    update cwd_user set directory_id=<Confluence Internal ID> where directory_id=<External Application ID>;
  • 刪除外部應用目錄
  • 你需要移動你的系統中的目錄順序,將內部用戶目錄移動到系統目錄列表中的最頂端,然后激活它。

    • 列出內部目錄。一個被激活的目錄將會在字段 'active' 中設置為 'T'

      select id, directory_name, active from cwd_directory where id = <Internal Directory id>;
    • 如果內部目錄不是激活的,請激活它

      update cwd_directory set active = 'T' where id = <Internal Directory id>;
    • 列出所有用戶的排序列表

      select d.id, d.directory_name, m.list_index from cwd_directory d join cwd_app_dir_mapping m on d.id=m.directory_id order by m.list_index;
    • 修改列表索引,這樣這些目錄將會按照你希望的順序進行排序。用戶目錄的排序可以使用下面的方法進行重排序

      update cwd_app_dir_mapping set list_index = <position> where directory_id = <directory id>;
  • 如果你僅僅有 2 個目錄 - 內部和外部目錄的刪除可以用下面的腳本:

    update cwd_app_dir_mapping set list_index = 0 where directory_id = <Confluence Internal ID>;
  • 如果你具有超過 2 個的用戶目錄,你需要將你的內部目錄移動到頂部(list_index 0)需要刪除的外部目錄在這個目錄的后面。

  • 檢查內部目錄是否被啟用。

  • 當所有的目錄排序是正確的話,從目錄列表中刪除外部應用目錄:

    delete from cwd_app_dir_operation where app_dir_mapping_id = (select id from cwd_app_dir_mapping where directory_id = <External Application ID>);delete from cwd_app_dir_mapping where directory_id = <External Application ID>;

    如果被刪除的外部目錄在系統中與其他的表有約束的話,你需要根據這些約束從數據庫中先刪除其他表中的數據:

    delete from cwd_directory_attribute where directory_id=<External Application ID>;delete from cwd_directory_operation where directory_id=<External Application ID>;

    所有引用的外部目錄現在應該可以從系統中被刪除了。使用下面的命令進行刪除:

    delete from cwd_directory where id = <External Application ID>;
    重置密碼
  • 所有在你刪除的外部目錄中的用戶現在還不能登錄系統,包括外部目錄的管理員。這些用戶需要先重置密碼后才能登錄系統。你可以通知你的用戶使用登錄頁面的 忘記你的密碼(Forgot your password)連接重置密碼。可選的你可以使用Restore Passwords To Recover Admin User Rights頁面的內容重置管理員的密碼,然后通過管理員界面中的管理用戶選項為你的用戶重置密碼。

  • ?

    https://www.cwiki.us/display/CONFLUENCEWIKI/Reverting+from+Crowd+or+JIRA+applications+to+Internal+User+Management


    轉載于:https://blog.51cto.com/ossez/2103374

    總結

    以上是生活随笔為你收集整理的Confluence 6 选项 2 – 转移 Crowd/Jira 应用程序中的用户和用户组到 Co的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。