To populate a stand-alone directory server with data, use one of the following methods:
Import the data from an LDAP Data Interchange Format (LDIF) file while you are setting up the server, either by using the setup utility in GUI mode or by using the setup utility in interactive command-line mode. This is the most convenient method of initializing a stand-alone server or the first server in a replicated topology.
Start with an empty suffix and add entries by using the ldapmodify command, for example:
$ ldapmodify -h hostname -p 1389 -D "cn=Directory Manager" -w password \ -a -f /usr/local/add_entry.ldif
Import data from an LDIF file, using the import-ldif command. For example:
$ import-ldif -b dc=example,dc=com -n userRoot -l /var/tmp/Example.ldif
This method is much more efficient for the addition of bulk entries. The import-ldif command imports data from an LDIF file either by replacing any existing data in the suffix or by appending data to a base DN. Similarly, the export-ldif command exports entries from a database to an LDIF file, which can then be imported to another server. Both tools support file compression, SASL extension, and client/server authentication using SSL and startTLS.
Copy the binary database from another server. This method is also called binary copy.
$ cp instance-path/db/example.db destination-path/db
Restore the database from a backup using the restore command, for example:
$ restore -d /home/backup/userRoot
Note - Performing a binary database copy or restoring a database from a backup requires the source server and the destination server to have the same database back-end structures and indexes.