1.2. Command-Line Tools

All OpenDJ command-line tools take the --help option.

All commands call Java programs and therefore involve starting a JVM.

Setup, upgrade, and uninstall tools are located in the directory where you unpacked OpenDJ, such as /path/to/opendj. Find the additional command-line tools for your platform.

  • (UNIX) In opendj/bin.

  • (Windows) In opendj\bat.

The following list uses the UNIX names for the tools. On Windows all command-line tools have the extension .bat.

backup

Backup or schedule backup of directory data.

base64

Encode and decode data in base64 format.

Base64 encoding represents binary data in ASCII, and can be used to encode character strings in LDIF, for example.

create-rc-script (UNIX)

Generate a script you can use to start, stop, and restart the server either directly or at system boot and shutdown. Use create-rc-script -f script-file.

dbtest

Debug JE databases.

dsconfig

The dsconfig command is the primary command-line tool for viewing and editing OpenDJ configuration. When started without arguments, dsconfig prompts you for administration connection information. Once connected it presents you with a menu-driven interface to the server configuration.

When you pass connection information, subcommands, and additional options to dsconfig, the command runs in script mode and so is not interactive.

You can prepare dsconfig batch scripts by running the tool with the --commandFilePath option in interactive mode, then reading from the batch file with the --batchFile option in script mode. Batch files can be useful when you have many dsconfig commands to run and want to avoid starting the JVM and setting up a new connection for each command.

In addition to the dsconfig reference that covers subcommands, the Configuration Reference covers the properties you can set using the dsconfig command.

dsjavaproperties

Apply changes you make to opendj/config/java.properties, which sets Java runtime options.

dsreplication

Configure data replication between directory servers to keep their contents in sync.

encode-password

Encode a clear text password according to one of the available storage schemes.

export-ldif

Export directory data to LDAP Data Interchange Format, a standard, portable, text-based representation of directory content.

import-ldif

Load LDIF content into the directory, overwriting existing data.

ldapcompare

Compare the attribute values you specify with those stored on entries in the directory.

ldapdelete

Delete one entry or an entire branch of subordinate entries in the directory.

ldapmodify

Modify the specified attribute values for the specified entries.

Use the ldapmodify command with the -a option to add new entries.

ldappasswordmodify

Modify user passwords.

ldapsearch

Search a branch of directory data for entries matching the LDAP filter that you specify.

ldif-diff

Display differences between two LDIF files, with the resulting output having LDIF format.

ldifmodify

Similar to the ldapmodify command, modify specified attribute values for specified entries in an LDIF file.

ldifsearch

Similar to the ldapsearch command, search a branch of data in LDIF for entries matching the LDAP filter you specify.

list-backends

List backends and base DNs served by OpenDJ.

make-ldif

Generate directory data in LDIF, based on templates that define how the data should appear.

The make-ldif command is designed to help you quickly generate test data that mimics data you expect to have in production, but without compromising private information.

manage-account

Lock and unlock user accounts, and view and manipulate password policy state information.

manage-tasks

View information about tasks scheduled to run in the server, and cancel specified tasks.

rebuild-index

Rebuild an index stored in a JE backend.

restore

Restore user data from backup.

start-ds

Start OpenDJ directory server.

status

Display information about the server.

stop-ds

Stop OpenDJ directory server.

verify-index

Verify that an index stored in a JE backend is not corrupt.

windows-service.bat (Windows)

Register OpenDJ as a Windows Service.