File tree Expand file tree Collapse file tree
opendj-doc-generated-ref/src/main/asciidoc/admin-guide
opendj-packages/opendj-docker/bootstrap Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 information: "Portions copyright [year] [name of copyright owner]".
1313
1414 Copyright 2017 ForgeRock AS.
15- Portions Copyright 2024 3A Systems LLC.
15+ Portions Copyright 2025 3A Systems LLC.
1616////
1717
1818:figure-caption!:
@@ -348,6 +348,26 @@ enabled : true
348348index-entry-limit : 4000
349349writability-mode : enabled
350350----
351+
352+ If you want to add a base entry, create a template file with the base DN, for example `base.template`:
353+ [source]
354+ ----
355+ branch: dc=example,dc=com
356+ ----
357+
358+ And then use the `import-ldif` tool to import a template file as shown in the following example:
359+
360+ [source, console]
361+ ----
362+ $ /opt/opendj/bin/import-ldif \
363+ --templateFile base.template \
364+ --backendID myData \
365+ --bindDN "cn=Directory Manager" \
366+ --bindPassword password
367+ ----
368+
369+ For details see xref:../reference/admin-tools-ref.adoc#import-ldif-1[import-ldif(1)] in the __Reference__.
370+
351371Alternatively, you can create a new backend in OpenDJ control panel (Directory Data > New Base DN > Backend > New Backend: __backend-name__).
352372When you create a new backend using the `dsconfig` command, OpenDJ directory server creates the following indexes automatically:
353373[none]
Original file line number Diff line number Diff line change @@ -41,18 +41,12 @@ echo "creating backend: $BACKEND_TYPE db-directory: ${BACKEND_DB_DIRECTORY}"
4141 --set enabled:true --no-prompt --trustAll
4242
4343if [ " $ADD_BASE_ENTRY " = " --addBaseEntry" ]; then
44-
45- DC=$( echo " $BASE_DN " | awk -F' ,|=' ' {print $2}' )
46-
47- /opt/opendj/bin/ldapmodify --hostname localhost \
48- --port 1636 --bindDN " $ROOT_USER_DN " --bindPassword " $ROOT_PASSWORD " \
49- --useSsl --trustAll << EOF
50- dn: $BASE_DN
51- dc: $DC
52- objectClass: domain
53- objectClass: top
54- EOF
55-
44+ echo " creating base entry..."
45+ BASE_TEMPLATE=$( mktemp)
46+ echo " branch: $BASE_DN " > $BASE_TEMPLATE
47+ /opt/opendj/bin/import-ldif --templateFile $BASE_TEMPLATE \
48+ --backendID=userRoot --bindDN " $ROOT_USER_DN " --bindPassword " $ROOT_PASSWORD "
49+ rm $BASE_TEMPLATE
5650fi
5751
5852
You can’t perform that action at this time.
0 commit comments