How to migrate from libdb to a different key-value database

Solution Unverified - Updated

Environment

You use libdb on RHEL 8 or RHEL 9 and want to upgrade to RHEL 10, where libdb is no longer available.

Issue

The libdb package was deprecated in Red Hat Enterprise Linux (RHEL) 9 and has been removed from RHEL 10.

Users of libdb who want to upgrade to RHEL 10 must migrate to a different key-value database before switching to RHEL 10.

Resolution

RHEL 9.5 provides libdb 5.3.28. The libdb-utils package provides a utility for conversion to GDBM database format.

On the RHEL 9 host:

  1. Ensure whether migration is needed. Check your binaries and search for a libdb requirement, for example:

    $ find /usr/bin /usr/local/bin -type f -executable -exec ldd {} + 2>/dev/null | grep libdb
    
  2. Locate your database’s files. Use the file utility to determine the type of the database file.

  3. Select your future database backend. For a list of possible replacements, see the Red Hat Knowledgebase solution Available replacements for the deprecated Berkeley DB (libdb).

  4. In the case of GDBM, you can use the db_converter utility included in the libdb-utils package. To install the package, enter:

    $ dnf install libdb-utils
    
  5. Backup your database.

  6. Run db_converter, for example:

    $ db_converter --src access.db --dest access.gdbm
    
  7. Adapt your application for the GDBM database backend.

Alternatively, the libdb package is available in the unsupported EPEL 10 repository.

Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.