| Action | Import | Initialize Database |
|---|---|---|
| Overwrites database | No | Yes |
| LDAP operations | Add, modify, delete | Add only |
| Performance | More time-consuming | Fast |
| Partition speciality | Works on all partitions | Local partitions only |
| Response to server failure | Best effort (all changes made up to the point of the failure remain) | Atomic (all changes are lost after a failure) |
| LDIF file location | Local to Console | Local to Console or local to server |
Imports configuration information (cn=config)
| Yes | No |
ldapmodify operation is executed to append data, as well as to modify and delete entries. The operation is performed on all of the databases managed by the Directory Server and on remote databases to which the Directory Server has a configured database link.
ldif2db import operations.
Directory Manager in order to initialize a database because an LDIF file that contains a root entry cannot be imported into a database except as the Directory Manager (root DN). Only the Directory Manager has access to the root entry, such as dc=example,dc=com.
o=NetscapeRoot suffix unless you are restoring data. Otherwise, initializing the database deletes information and may require re-installing the Directory Server.
/var/lib/dirsrv/slapd-instance_name/ldif. [3]
-E option with the script. See Section 3.2.3.5, “Exporting and Importing an Encrypted Database” for more information.
ldif2db script overwrites the data in the specified database. Also, the script requires that the Directory Server be stopped when the import begins.
o=NetscapeRoot configuration information with the o=NetscapeRoot configuration information in the files being imported.
service dirsrv stop instance
cd /usr/lib/dirsrv/slapd-instance_name
ldif2db command-line script.
ldif2db -n Database1 -i /var/lib/dirsrv/slapd-instance_name/ldif/demo.ldif -i /var/lib/dirsrv/slapd-instance_name/ldif/demo2.ldif
-n option does not correspond with the suffix contained by the LDIF file, all of the data contained by the database is deleted, and the import fails. Make sure that the database name is not misspelled.
| Option | Description |
|---|---|
| -i |
Specifies the full path name of the LDIF files to be imported. This option is required. To import more than one LDIF file at a time, use multiple -i arguments. When multiple files are imported, the server imports the LDIF files in the order which they are specified from the command-line.
|
| -n | Specifies the name of the database to which to import the data. |
ldif2db script, the ldif2db.pl script overwrites the data in the specified database. This script requires the server to be running in order to perform the import.
cd /usr/lib/dirsrv/slapd-instance_name
ldif2db script.
ldif2db -D "cn=Directory Manager" -w secretpwd
-i /var/lib/dirsrv/slapd-instance_name/ldif/demo.ldif -n Database1
root privileges to run the script, but you must authenticate as the Directory Manager.
| Option | Description |
|---|---|
| -D | Specifies the DN of the administrative user. |
| -w | Specifies the password of the administrative user. |
| -i |
Specifies the LDIF files to be imported. This option is required. To important multiple LDIF files at a time, use multiple -i arguments. When multiple files are imported, the server imports the LDIF files in the order they are specified in the command-line.
|
| -n | Specifies the name of the database to which to import the data. |
ldif2ldap script appends the LDIF file through LDAP. Using this script, data are imported to all directory databases at the same time. The server must be running in order to import using ldif2ldap.
ldif2ldap, do the following:
cd /usr/lib/dirsrv/slapd-instance_name
ldif2ldap command-line script.
ldif2ldap "cn=Directory Manager" secretpwd /var/lib/dirsrv/slapd-instance_name/ldif/demo.ldif
ldif2ldap script requires the DN of the administrative user, the password of the administrative user, and the absolute path and filename of the LDIF files to be imported.
[3] This is the location for Red Hat Enterprise Linux 5 (32-bit). File locations for other platforms are listed in Section 1.1, “Directory Server File Locations”.
[4] The command to start and stop the Directory Server on platforms other than Red Hat Enterprise Linux 5 (32-bit) is described in Section 1.3, “Starting and Stopping Servers”.