# LDAP Server Change / User migration

**URL:** <https://help.nextcloud.com/t/ldap-server-change-user-migration/34085>\
**Category:** ℹ️ Support\
**Tags:** ldap\
**Created:** [July 17, 2018, 8:03am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085 "2018-07-17T08:03:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Vetters](https://help.nextcloud.com/letter_avatar/erik_vetters/32/6_22734026db12803ebb3e059622ac3534.png) [@Erik\_Vetters](https://help.nextcloud.com/u/Erik_Vetters)\
**Post date:** [July 17, 2018, 8:03am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/1 "2018-07-17T08:03:53Z")

</div>

Hi,

I’m running into an issue. I have a basic setup where multiple users are authenticated against LDAP ( Active Directory). I have no issue with that.

Now I have the issue that must switch the LDAP server to a new Active Directory domain. Users are the same and usernames remains the same here.

If I switch to that new LDAP/AD Server, the users are created as new users as the LDAP structure has changed completed.

How do I manage/handle this ? Is there a script to rewrite the user in the tables with that  
new structure. So that the users ID in nextcloud and the data remains the same, just the authentication is done at a new backend.

Has anybody done this before ?

I hope someone has something 😉

Many Greetings  
Erik

---

<div class="post-metadata">

**Author:** ![yourcloudasia](https://help.nextcloud.com/user_avatar/help.nextcloud.com/yourcloudasia/32/8124_2.png) [@yourcloudasia](https://help.nextcloud.com/u/yourcloudasia)\
**Post date:** [July 18, 2018, 2:11am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/2 "2018-07-18T02:11:20Z")

</div>

The user is based on the LDAP UUID, which is unique for each user. How are the home folders named in the data directory? If they are named using their username, there is a chance that the migration can be made easier by keeping the same username.

In the [Advanced](https://docs.nextcloud.com/server/11/admin_manual/configuration_user/user_auth_ldap.html#special-attributes) and [Expert](https://docs.nextcloud.com/server/11/admin_manual/configuration_user/user_auth_ldap.html#expert-settings) tabs of the LDAP app, what are the User Home Folder Naming Rule and Internal Username settings set to?

---

<div class="post-metadata">

**Author:** ![tong\_run](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tong_run/32/17477_2.png) [@tong\_run](https://help.nextcloud.com/u/tong_run)\
**Post date:** [September 5, 2019, 9:00am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/3 "2019-09-05T09:00:54Z")

</div>

Hello, have you solved this problem? I encountered the same problem. When I changed the original ldap to freeipa, the original directory was created randomly by UUID, so a new folder will be created after replacing the ldap, and the original record will not be seen when logging in.I am looking forward to your reply if the problem is solved. Thank you

---

<div class="post-metadata">

**Author:** ![damian](https://help.nextcloud.com/user_avatar/help.nextcloud.com/damian/32/16312_2.png) [@damian](https://help.nextcloud.com/u/damian)\
**Post date:** [September 19, 2019, 4:51am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/4 "2019-09-19T04:51:31Z")

</div>

Hello, I have the same problem. I want to migrate an old samba to a new samba.  
Thank you

---

<div class="post-metadata">

**Author:** ![wieland](https://help.nextcloud.com/letter_avatar/wieland/32/6_22734026db12803ebb3e059622ac3534.png) [@wieland](https://help.nextcloud.com/u/wieland)\
**Post date:** [July 28, 2020, 5:29pm UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/5 "2020-07-28T17:29:59Z")

</div>

Hi everyone,

May we have the same problem.  
I have a workaround, but don’t know it this is a good way: [LDAP Migration with different DN](https://help.nextcloud.com/t/ldap-migration-with-different-dn/88449)

Did you find any solution so far?

May you find also useful this topic:

- [Migration to LDAP keeping users and data](https://help.nextcloud.com/t/migration-to-ldap-keeping-users-and-data/13205)
- [Migrating OpenLDAP to AD backend](https://help.nextcloud.com/t/migrating-openldap-to-ad-backend/35404)

---

<div class="post-metadata">

**Author:** ![ledufAkaDemy](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ledufakademy/32/7965_2.png) [@ledufAkaDemy](https://help.nextcloud.com/u/ledufAkaDemy)\
**Post date:** [September 14, 2020, 6:36am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/6 "2020-09-14T06:36:11Z")

</div>

you can use openldap in meta backend, proxy ldap mode.  
suffix massage option.  
no need to change something in njextcloud.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 7:23am UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/7 "2024-12-04T07:23:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 3:01pm UTC](https://help.nextcloud.com/t/ldap-server-change-user-migration/34085/8 "2024-12-09T15:01:24Z")

</div>


