Hello dear community,
I have to migrate our ldap database from OpenLDAP (from 2019 version hosted on Debian, to Symas OpenLDAP 2.4.59 on ). I need to change our DN from "dc=lexp,dc=fr" to "dc=directory,dc=lan-explore,dc=fr".
I installed OpenLDAP and configure directory with new DN.
For data migration, I exported data: slapcat -b dc=lexp,dc=fr > /tmp/20230616_save_data.ldif
.. and for recovery, I changed all dn mentions from old to new dn.
1. Is the correct way? When import, you can see error message: slapadd: slap_init invalid suffix ("dc=directory,dc=lan-explore,dc=fr ") 2. When searching, I discovered that each line can contains 77 columns. Next, line is truncated, and it's difficult to replace all dn.
Thanks,
Jean-Luc
If you include '-o ldif_wrap=no' that should prevent the line wrapping and will make the subsequent regex replace straightforward to do with tools such as sed. Check out the man page for slapcat if you need more detail.
Best, Aaron
-----Original Message----- From: Jean-Luc Chandezon jlch@lan-explore.fr Sent: Friday, June 16, 2023 10:19 AM To: openldap-technical@openldap.org Subject: Data migration
Warning: This email is from outside the company. Be careful clicking links or attachments.
Hello dear community,
I have to migrate our ldap database from OpenLDAP (from 2019 version hosted on Debian, to Symas OpenLDAP 2.4.59 on ). I need to change our DN from "dc=lexp,dc=fr" to "dc=directory,dc=lan-explore,dc=fr".
I installed OpenLDAP and configure directory with new DN.
For data migration, I exported data: slapcat -b dc=lexp,dc=fr > /tmp/20230616_save_data.ldif
.. and for recovery, I changed all dn mentions from old to new dn.
1. Is the correct way? When import, you can see error message: slapadd: slap_init invalid suffix ("dc=directory,dc=lan-explore,dc=fr ") 2. When searching, I discovered that each line can contains 77 columns. Next, line is truncated, and it's difficult to replace all dn.
Thanks,
Jean-Luc
---------------------------------------------------------------------- The information contained in this message may be privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify your representative immediately and delete this message from your computer. Thank you.
--On Friday, June 16, 2023 3:19 PM +0000 Jean-Luc Chandezon jlch@lan-explore.fr wrote:
Hello dear community,
I have to migrate our ldap database from OpenLDAP (from 2019 version hosted on Debian, to Symas OpenLDAP 2.4.59 on ). I need to change our DN from "dc=lexp,dc=fr" to "dc=directory,dc=lan-explore,dc=fr".
Hello,
The OpenLDAP 2.4 series is historic and no longer supported. I would *strongly* advise upgrading to a supported release series. If you are unable to do this yourself, I would recommend using either the packages from Symas or the LTB project:
https://repo.symas.com/ https://ltb-project.org/
Depending on the version of OpenLDAP you are running, it may be possible to export without linewraps by adding the:
-o ldif-wrap=no
option to your slapcat invocation.
You will also need to update your slapd configuration such that it refers to the new root do your DIT, which your slapadd error indicates was not done.
Regards, Quanah
Am 16.06.23 um 16:30 schrieb Quanah Gibson-Mount:
-o ldif-wrap=no
man slapadd say "-o ldif_wrap=no" (note the underscore)
Is one version legacy, and the other preferred? This commit looks like the underscore is preferred: https://github.com/openldap/openldap/commit/8a259e3df16def3f05828f355e98a508...
Andreas
--On Friday, June 16, 2023 10:00 PM +0200 "A. Schulze" sca@andreasschulze.de wrote:
Am 16.06.23 um 16:30 schrieb Quanah Gibson-Mount:
-o ldif-wrap=no
man slapadd say "-o ldif_wrap=no" (note the underscore)
Is one version legacy, and the other preferred?
They're equivalent. The code even uses both in debug messages in slapcommon.c:
} else if ( ( strncasecmp( optarg, "ldif_wrap", len ) == 0 ) || ( strncasecmp( optarg, "ldif-wrap", len ) == 0 ) ) {
Debug( LDAP_DEBUG_ANY, "unable to parse ldif_wrap="%s".\n", p );
Debug( LDAP_DEBUG_ANY, "ldif-wrap meaningless for tool.\n" );
--Quanah
openldap-technical@openldap.org