A.4. Utilities for Restoring and Backing up Databases: ldif2db
Imports LDIF files to the database.
ns-slapd ldif2db
-D configDir
-i ldifFile
[
-d debugLevel
] [
-g string
] [
-n backendInstance
] [
-O
] [
-s includeSuffix
] [
-x excludeSuffix
] [
-E
]
Enter the full path to the server configuration directory (configdir). ldifFile is the name of the file containing the LDIF to be imported. There is an example LDIF file under the /var/lib/dirsrv/slapd- directory. Either the instance_name/ldif-n or the -s option must be specified.
| Option | Description |
|---|---|
| -d debugLevel | Specifies the debug level to use during runtime. For further information, refer to Section 2.3.1.42, “nsslapd-errorlog-level (Error Log Level)”. |
| -D configDir |
Specifies the location of the server configuration directory that contains the configuration information for the import process. This must be the fulle path to the configuration directory, /etc/dirsrv/slapd-.
|
| -E | Decrypts an encrypted database during export. This option is used only if database encryption is enabled. |
| -g string |
Generates a unique ID. Type
When using the -g deterministic
namespaceId is a string of characters in the format Use this option to import the same LDIF file into two different Directory Servers and the contents of both directories should have the same set of unique IDs. If unique IDs already exist in the LDIF file being imported, then the existing IDs are imported to the server, regardless of the options specified. |
| -i ldifFile |
Specifies the LDIF file to be imported. This option is required. There can be multiple -i arguments to import more than one LDIF file at a time. When importing multiple files, the server imports the LDIF files in the order they are specified on the command line.
|
| -n backendInstance | Specifies the name of the backend to be imported. |
| -O | Specifies that no attribute indexes are created for the imported database. If this option is specified and the indexes need to be restored later, the indexes have to be recreated by hand. See the Directory Server Administration Guide for further information. |
| -s includeSuffix | Specifies the suffix or suffixes within the LDIF file to import. |
| -x excludeSuffix |
Specifies suffixes within the LDIF file to exclude during the import. There can be multiple -x arguments. This option can selectively import portions of the LDIF file. If both -x and -s are used with the same suffix, -x takes precedence. Exclusion always takes precedence over inclusion. If -x or -s are not specified, then all available suffixes will be imported from the LDIF file. To import the LDIF file into the configuration directory, do not exclude o=NetscapeRoot.
|