Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 7. Migrating the database type from BDB to LMDB on an existing DS instance


If you have an instance with the Berkeley Database (BDB) backend, you can change the BDB on this instance to Lightning Memory-Mapped Database (LMDB).

Note

Migration from BDB to LMDB is available only for instances with Directory Server version 12.5 or later.

In mixed environment, consider the following limitations:

  • You cannot use a backup to restore an instance with a different database type, because backup and restore formats are tied to this type.
  • You cannot mix backends with different types on an instance.

However, the following mix of implementations is possible:

  • You can mix instances with different backend types on a host.
  • You can mix replicas with different types in your replicated topology.

Currently, you can use only the command line to migrate from BDB to LMDB or backwards.

7.1. Migrating the database type from BDB to LMDB using dsctl

You can use the dsctl utility to automatically migrate the Berkeley Database (BDB) backend on an instance to the Lightning Memory-Mapped Database (LMDB).

Prerequisites

  • You have root permissions.

Procedure

  1. Start the migration from BDB to LMDB:

    # dsctl instance_name dblib bdb2mdb
    ...
    Backends importation 0.000000% (userroot)
    Backends importation 100%
    Copy to Clipboard Toggle word wrap

    The command sets the nsslapd-backend-implement global configuration parameter to mdb and calculates the database size that you can adjust by setting the nsslapd-mdb-max-size parameter value.

  2. Remove the migration .ldif file and the old database:

    # dsctl instance_name dblib cleanup
    cleanup dbmapdir=/var/lib/dirsrv/slapd-instance_name/db dbhome=/dev/shm/slapd-instance_name dblib=mdb
    Copy to Clipboard Toggle word wrap

Note that you can migrate back from LMDB to BDB by using the dsctl instance_name dblib mdb2bdb command.

Verification

  • Check that the nsslapd-backend-implement configuration parameter value is set to mdb:
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
Enter password for cn=Directory Manager on ldap://server.example.com: password
nsslapd-backend-implement: mdb
Copy to Clipboard Toggle word wrap

7.2. Manually migrating the database type from BDB to LMDB

Use manual migration from the Berkeley Database (BDB) backend on an instance to the Lightning Memory-Mapped Database (LMDB) in the following cases:

  • The migration by the dsctl utility cannot be performed.
  • You want to set LMDB configuration attributes manually.

Prerequisites

  • You have root permissions.
  • You have the Directory Manager password.

Procedure

  1. Export all your databases to an LDIF file as described in Exporting data using the command line while the server is offline.
  2. Determine the LMDB database maximum size by clarifying the existing databases size and adding a safety margin of 20%. Skip this step if you migrate back from LMDB to BDB.

    1. Clarify the existing databases size:

      # du -hs /var/lib/dirsrv/slapd-instance_name/db/*/ 
      1.8GB
      Copy to Clipboard Toggle word wrap
    2. Add the safety margin of 20%:

      1.8 GB + 20% = 2.16 GB
      Copy to Clipboard Toggle word wrap

      You require the maximum database size in the future steps.

  3. Change the database type to LMDB on the instance and restart the instance:

    # dsconf instance_name backend config set --db-lib mdb
    Successfully updated database configuration
    
    # dsctl instance_name restart
    Instance "instance_name" has been restarted
    Copy to Clipboard Toggle word wrap

    When you migrate back from LMDB to BDB, set the --db-lib option to bdb.

  4. Set the LMDB maximum size to the value you calculated in the previous steps (2.16 GB) in bytes and restart the instance:

    # dsconf instance_name backend config set --mdb-max-size 2319282339
    Successfully updated database configuration
    
    # dsctl instance_name restart
    Instance "instance_name" has been restarted
    Copy to Clipboard Toggle word wrap

    The command sets the nsslapd-mdb-max-size configuration parameter value.

    Note

    Skip this step if you migrate back from LMDB to BDB.

  5. Import all databases from the LDIF file as described in Importing data using the command line while the server is offline.

Verification

  • Check that the nsslapd-backend-implement configuration parameter value is set to mdb:
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
Enter password for cn=Directory Manager on ldap://server.example.com: password
nsslapd-backend-implement: mdb
Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat