10.4. Exporting and Importing an Encrypted Database
Exporting and importing encrypted databases is similar to exporting and importing regular databases. However, the encrypted information must be decrypted when you export the data and re-encrypted when you reimport it to the database.
10.4.1. Exporting an Encrypted Database
To export data from an encrypted database, pass the
-Eparameter to the
For example, to export the complete
userRootdatabase with decrypted attributes:
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend export -E userRoot
Alternatively, you can export only a specific subtree. For example, to export all data from the
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend export -E -s "ou=People,dc=example,dc=com" userRoot
For further details about using
dsconfto export data, see Section 22.214.171.124.1, “Exporting a Databases Using the
dsconf backend exportCommand”.
10.4.2. Importing an LDIF File into an Encrypted Database
To import data to a database when attribute encryption is enabled:
- Stop the Directory Server instance:
# dsctl instance_name stop
- If you replaced the certificate database between the last export and this import, edit the
/etc/dirsrv/slapd-instance_name/dse.ldiffile, and remove the following entries including their attributes:
cn=AES,cn=encrypted attribute keys,cn=database_name,cn=ldbm database,cn=plugins,cn=config
cn=3DES,cn=encrypted attribute keys,cn=database_name,cn=ldbm database,cn=plugins,cn=config
ImportantRemove the entries for all databases. If any entry that contains the
nsSymmetricKeyattribute is left in the
/etc/dirsrv/slapd-instance_name/dse.ldiffile, Directory Server will fail to start.
- Import the LDIF file. For example, to import the
# dsctl instance_name ldif2db --encrypted userRoot /tmp/example.ldifThe
--encryptedparameter enables the script to encrypt attributes configured for encryption during the import.
- Start the instance:
# dsctl instance_name start