> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/ar/idarh-almstkhdmyn-walmsharya/user-management/username-migration.md).

# ترحيل أسماء المستخدمين

## ترحيل أسماء المستخدمين

من منظور تسجيل الدخول، فإن المعرّف الأساسي للمستخدم هو عنوان بريده الإلكتروني. إذا كنت تنتقل من المصادقة المحلية إلى SSO أو كنت تنتقل من موفّر هوية (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` يجب ضبطه على معرّف المسؤول الذي ينفذ الترحيل، وسيُستخدم في إدخالات سجل التدقيق. انتقل إلى **الإدارة** > **إدارة المستخدمين** وابحث عن عنوان بريدك الإلكتروني، ثم انقر على النتيجة الأولى للعثور على معرّف المستخدم الخاص بك. |
| `<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://overleaf-pro.ayaka.space/on-premises/ar/idarh-almstkhdmyn-walmsharya/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.
