> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/yzoyobipurojekuto/user-management/username-migration.md).

# ユーザー名の移行

## ユーザー名の移行

ログインの観点では、ユーザーの主な識別子はメールアドレスです。ローカルベースの認証から SSO に移行している場合、またはある IdP から別の IdP へ移行している場合は、ユーザーのメールアドレスを更新する必要がある場合があります。

これを支援するために、以下の形式の CSV ファイルを使用してユーザーのメールアドレスを移行するスクリプトが用意されています：

`oldEmail,newEmail`

いくつかの検証チェックを実行した後、スクリプトは CSV ファイルを順に処理し、ユーザーのメールアドレスを次から更新します `oldEmail` から `newEmail`.

### **検証**

移行を実行する前に、 `<csv_file>` がチェックされ、次のことが確認されます：

* 各行について、 `oldEmail` と `newEmail` はいずれも有効なメールアドレスであること
* 重複エントリがないこと。たとえば、異なるユーザーを同じ新しいメールアドレスに更新しようとしていないこと、または既に使用されているメールアドレスで同じユーザーアカウントを更新しようとしていないこと

### **使い方** <a href="#usage" id="usage"></a>

{% code overflow="wrap" %}

```bash
docker cp <csv_file> sharelatex:/overleaf/services/web/<csv_file> docker exec sharelatex /bin/bash -c "cd /overleaf/services/web;node ./modules/server-ce-scripts/scripts/migrate-user-emails.js [--commit] [--continue|--ignore-missing] [--admin-id=ADMIN_USER_ID] <csv_file>"
```

{% endcode %}

### **フラグ** <a href="#flags" id="flags"></a>

| 名前                 | 説明                                                                                                                                                   |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--commit`         | <p>この <code>--commit</code> フラグを指定すると実際に移行が実行されます。省略した場合、移行はドライランモードで実行され、変更は行われませんが検証は引き続き実行されます。<br><br><strong>既定</strong>:<code>false</code></p> |
| `--continue`       | 次の `--continue` フラグは、アカウントのメールアドレスがすでに更新されているユーザーアカウントがある場合、移行処理を続行します                                                                               |
| `--ignore-missing` | 次の `--ignore-missing` フラグは、ユーザーアカウントが見つからなかった場合、移行処理を続行します                                                                                           |
| `--admin-id`       | 次の `--admin-id` は、移行を実行する管理者の ID に設定する必要があり、監査ログのエントリに使用されます。へ移動し、 **管理者** > **ユーザーを管理** メールアドレスを検索して、最初の結果をクリックするとユーザー ID を確認できます。                  |
| `<csv_file>`       | 次の `<csv_file>` は、古いメールアドレスと新しいメールアドレスが含まれるファイルです。                                                                                                   |

### **完了** <a href="#completion" id="completion"></a>

移行スクリプトの実行中、選択したフラグによって、エラーがコンソールに記録されて続行するか、コンソールに記録されて終了するかが決まります。エラーによりスクリプトが途中で終了した場合は、失敗を示すために終了コード 1 で終了します。

移行が完了すると、スクリプトは成功、失敗、スキップされた更新の件数をコンソールに記録します。移行が正常に完了した場合は、終了コード 0 で終了します。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/ja/yzoyobipurojekuto/user-management/username-migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
