How to generate test LDIF data and import to LDAP server OpenDJ - OpenIdentityPlatform/OpenDJ GitHub Wiki

$ export VERSION="$(curl -i -o - --silent https://api.github.com/repos/OpenIdentityPlatform/OpenDJ/releases/latest | grep -m1 "\"name\"" | cut -d\" -f4)" 

$ echo "last release: $VERSION"
last release: 4.9.2

$ curl -L https://github.com/OpenIdentityPlatform/OpenDJ/releases/download/$VERSION/opendj-$VERSION.zip --output opendj.zip

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 72.4M  100 72.4M    0     0   865k      0  0:01:25  0:01:25 --:--:-- 1024k

$ unzip opendj
Archive:  opendj.zip
   creating: opendj/
   creating: opendj/QuickSetup.app/

$ cd opendj

$ bin/makeldif -o test.ldif -c numusers=10000000  template/config/MakeLDIF/example.template
Processed 1000 entries
Processed 2000 entries
Processed 3000 entries
...
Processed 10000000 entries
LDIF processing complete. 10000002 entries written

$ ./setup --addBaseEntry -h localhost -p 1389 --ldapsPort 1636 --adminConnectorPort 4444 --enableStartTLS --generateSelfSignedCertificate --rootUserDN "cn=Directory Manager" --rootUserPassword password --baseDN dc=example,dc=com --cli --acceptLicense --no-prompt

Configuring Directory Server ..... Done.
Configuring Certificates ..... Done.
Creating Base Entry dc=example,dc=com ..... Done.
Starting Directory Server ....... Done.

To see basic server configuration status and configuration, you can launch
/private/tmp/opendj/bin/status

$ bin/import-ldif --ldifFile test.ldif --backendID=userRoot -h localhost -p 4444 --bindDN "cn=Directory Manager" --bindPassword password --trustAll

Import task 20250228170246618 scheduled to start immediately
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=0 msgID=org.opends.messages.backend-413 message="Import task 20250228170246618 started execution"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=1 msgID=org.opends.messages.backend-370 message="The backend userRoot is now taken offline"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=2 msgID=org.opends.messages.runtime-21 message="Installation Directory:  /private/tmp/opendj"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=3 msgID=org.opends.messages.runtime-23 message="Instance Directory:      /private/tmp/opendj"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=4 msgID=org.opends.messages.runtime-17 message="JVM Information: 23 by Homebrew, 64-bit architecture, 2147483648 bytes heap size"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=5 msgID=org.opends.messages.runtime-18 message="JVM Host: localhost, running Mac OS X 15.3.1 x86_64, 8589934592 bytes physical memory size, number of processors available 8"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=6 msgID=org.opends.messages.runtime-19 message="JVM Arguments: "--add-exports=java.base/sun.security.x509=ALL-UNNAMED", "--add-exports=java.base/sun.security.tools.keytool=ALL-UNNAMED", "--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED", "-Dorg.opends.server.scriptName=start-ds""
[28/февр./2025:17:02:46 +0300] severity="INFORMATION" msgCount=7 msgID=org.opends.messages.backend-410 message="JE backend 'userRoot' does not specify the number of cleaner threads: defaulting to 8 threads"
[28/февр./2025:17:02:46 +0300] severity="INFORMATION" msgCount=8 msgID=org.opends.messages.backend-411 message="JE backend 'userRoot' does not specify the number of lock tables: defaulting to 17"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=9 msgID=org.opends.messages.backend-533 message="OpenDJ Server 4.9.2 starting import (build 20250204155540, R2fa7a955ea1b9132f6bcfcce18f2979b31085734)"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=10 msgID=org.opends.messages.backend-528 message="The amount of free memory available to the import task is 1932735283 bytes. The number of phase one buffers required is 160 buffers"
[28/февр./2025:17:02:46 +0300] severity="NOTICE" msgCount=11 msgID=org.opends.messages.backend-520 message="Setting DB cache size to 33554432 bytes and phase one buffer size to 3623878 bytes"
[28/февр./2025:17:02:47 +0300] severity="NOTICE" msgCount=12 msgID=org.opends.messages.backend-534 message="Import Thread Count: 4 threads"
[28/февр./2025:17:10:59 +0300] severity="NOTICE" msgCount=13 msgID=org.opends.messages.backend-531 message="Total import time was 489 seconds. Phase one processing completed in 345 seconds, phase two processing completed in 144 seconds"
[28/февр./2025:17:10:59 +0300] severity="NOTICE" msgCount=14 msgID=org.opends.messages.backend-519 message="Processed 10000002 entries, imported 10000002, skipped 0, rejected 0 and migrated 0 in 492 seconds (average rate 20285,8/sec)"
[28/февр./2025:17:10:59 +0300] severity="NOTICE" msgCount=15 msgID=org.opends.messages.backend-526 message="Import LDIF environment close took 0 seconds"
[28/февр./2025:17:10:59 +0300] severity="NOTICE" msgCount=16 msgID=org.opends.messages.backend-518 message="Flushing data to disk"
[28/февр./2025:17:10:59 +0300] severity="INFORMATION" msgCount=17 msgID=org.opends.messages.backend-410 message="JE backend 'userRoot' does not specify the number of cleaner threads: defaulting to 8 threads"
[28/февр./2025:17:10:59 +0300] severity="INFORMATION" msgCount=18 msgID=org.opends.messages.backend-411 message="JE backend 'userRoot' does not specify the number of lock tables: defaulting to 17"
[28/февр./2025:17:11:00 +0300] severity="NOTICE" msgCount=19 msgID=org.opends.messages.backend-513 message="The database backend userRoot containing 10000002 entries has started"
[28/февр./2025:17:11:00 +0300] severity="NOTICE" msgCount=20 msgID=org.opends.messages.backend-414 message="Import task 20250228170246618 finished execution in the state Completed successfully"
Import task 20250228170246618 has been successfully completed

$ bin/status --bindDN "cn=Directory Manager" --bindPassword password

          --- Server Status ---
Server Run Status:        Started
Open Connections:         1

          --- Server Details ---
Host Name:                MacBook-Pro-Harseko.local
Administrative Users:     cn=Directory Manager
Installation Path:        /private/tmp/opendj
Version:                  OpenDJ Server 4.9.2
Java Version:             23
Administration Connector: Port 4444 (LDAPS)

          --- Connection Handlers ---
Address:Port : Protocol               : State
-------------:------------------------:---------
--           : LDIF                   : Disabled
0.0.0.0:161  : SNMP                   : Disabled
0.0.0.0:1389 : LDAP (allows StartTLS) : Enabled
0.0.0.0:1636 : LDAPS                  : Enabled
0.0.0.0:1689 : JMX                    : Disabled
0.0.0.0:8080 : HTTP                   : Disabled

          --- Data Sources ---
Base DN:     dc=example,dc=com
Backend ID:  userRoot
Entries:     10000002
Replication: