mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Maxim Thomas
22.26.2025 af8a89baf8976c199a04fc70464e3ce66c5dd8ca
[#530] Fixed error when creating a backend for BASE_DN with OU in Docker (#531)

2 files modified
40 ■■■■■ changed files
opendj-doc-generated-ref/src/main/asciidoc/admin-guide/chap-import-export.adoc 22 ●●●●● patch | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/setup.sh 18 ●●●●● patch | view | raw | blame | history
opendj-doc-generated-ref/src/main/asciidoc/admin-guide/chap-import-export.adoc
@@ -12,7 +12,7 @@
  information: "Portions copyright [year] [name of copyright owner]".
 
  Copyright 2017 ForgeRock AS.
  Portions Copyright 2024 3A Systems LLC.
  Portions Copyright 2025 3A Systems LLC.
////
:figure-caption!:
@@ -348,6 +348,26 @@
index-entry-limit : 4000
writability-mode  : enabled
----
If you want to add a base entry, create a template file with the base DN, for example `base.template`:
[source]
----
branch: dc=example,dc=com
----
And then use the `import-ldif` tool to import a template file as shown in the following example:
[source, console]
----
$ /opt/opendj/bin/import-ldif \
 --templateFile base.template \
 --backendID myData \
 --bindDN "cn=Directory Manager" \
 --bindPassword password
----
For details see xref:../reference/admin-tools-ref.adoc#import-ldif-1[import-ldif(1)] in the __Reference__.
Alternatively, you can create a new backend in OpenDJ control panel (Directory Data > New Base DN > Backend > New Backend: __backend-name__).
When you create a new backend using the `dsconfig` command, OpenDJ directory server creates the following indexes automatically:
[none]
opendj-packages/opendj-docker/bootstrap/setup.sh
@@ -41,18 +41,12 @@
  --set enabled:true --no-prompt --trustAll
if [ "$ADD_BASE_ENTRY" = "--addBaseEntry" ]; then
  DC=$(echo "$BASE_DN" | awk -F',|=' '{print $2}')
  /opt/opendj/bin/ldapmodify --hostname localhost \
    --port 1636 --bindDN "$ROOT_USER_DN" --bindPassword "$ROOT_PASSWORD" \
    --useSsl --trustAll <<EOF
dn: $BASE_DN
dc: $DC
objectClass: domain
objectClass: top
EOF
  echo "creating base entry..."
  BASE_TEMPLATE=$(mktemp)
  echo "branch: $BASE_DN" > $BASE_TEMPLATE
  /opt/opendj/bin/import-ldif --templateFile $BASE_TEMPLATE \
    --backendID=userRoot --bindDN "$ROOT_USER_DN" --bindPassword "$ROOT_PASSWORD"
  rm $BASE_TEMPLATE
fi