Chapter 2. Exporting data from Directory Server
Export data from the Directory Server database to an LDIF file using the command line or the web console.
The export operations include only directory data. Export does not include the configuration information (cn=config), schema information (cn=schema), and monitoring information (cn=monitor).
Use the export feature to:
- Copy data to another Directory Server.
- Export data to another application.
- Repopulate databases after a change to the directory topology.
- Split the database.
2.1. Exporting data using the command line while the server is running Copy linkLink copied to clipboard!
To export data while the Directory Server instance is running, use the dsconf backend export command.
Prerequisites
The
dirsrvuser has write permissions in the destination directory.Note that Directory Server uses its own private directories by default. As a result, backups and exports under directories
/var/tmp/,/tmp/, and/root/fail unless you disabled the PrivateTmp systemd directive.- The Directory Server instance is running.
Procedure
Use the
dsconf backend exportcommand to export data to an LDIF file.For example, to export the
userRootdatabase:dsconf -D "cn=Directory Manager" ldap://server.example.com backend export userRoot
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend export userRoot The export task has finished successfullyCopy to Clipboard Copied! Toggle word wrap Toggle overflow By default,
dsconfstores the export in a file calledinstance_name_database_name-time_stamp.ldifin the/var/lib/dirsrv/slapd-instance_name/ldif/directory. Alternatively, add the-l file_nameoption to the command to specify a different location.-
Search the
/var/log/dirsrv/slapd-instance_name/errorslog for problems during the export.
2.2. Exporting data using the command line while the server is offline Copy linkLink copied to clipboard!
If the Directory Server instance is offline, use the dsctl db2ldif command to export data.
Prerequisites
The
dirsrvuser has write permissions in the destination directory.Note that Directory Server uses its own private directories by default. As a result, backups and exports under directories
/var/tmp/,/tmp/, and/root/fail unless you disabled the PrivateTmp systemd directive.- The Directory Server instance is not running.
Procedure
Use the
dsctl db2ldifcommand to export data to an LDIF file. For example, to export theuserRootdatabase to the/var/lib/dirsrv/slapd-instance_name/ldif/example.ldiffile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Search the
/var/log/dirsrv/slapd-instance_name/errorslog for problems during the export. Optional: Start the instance:
dsctl instance_name start
# dsctl instance_name startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Exporting data using the web console while the server is running Copy linkLink copied to clipboard!
Directory Server supports exporting data using the web console.
Prerequisites
The
dirsrvuser has write permissions in the destination directory.Note that Directory Server uses its own private directories by default. As a result, backups and exports under directories
/var/tmp/,/tmp/, and/root/fail unless you disabled the PrivateTmp systemd directive.- The Directory Server instance is running.
- You are logged in to the instance in the web console.
Procedure
- Open the menu.
- Select the suffix entry.
-
Click , and select
Export Suffix. -
Enter the name of the LDIF file in which you want to store the export. Directory Server will store the file in the
/var/lib/dirsrv/slapd-instance_name/ldif/directory using the specified file name. - Click .
-
To check the log for problems during the export, open the
menu.