Este conteúdo não está disponível no idioma selecionado.

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%

    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

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

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
    2. Add the safety margin of 20%:

      1.8 GB + 20% = 2.16 GB

      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

    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

    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
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo