5.3. Database Migration Methods

Important

Make sure to always perform the pre-migration tasks as described in Section 5.2, “Pre-migration Tasks” before the database migration.

5.3.1. The Export and Import Migration Method

The export and import migration method is the process of exporting a back-end database to an LDIF file. You will then import the LDIF file on the new server. You must perform this task for each back end defined in the Directory Server instance.
The example below shows two back ends being exported and imported from and to a single Directory Server instance.

Example 5.1. Exporting and importing two back ends from and to a single instance

  1. On the previous Directory Server version, use the db2ldif utility by running the following commands:
    # /usr/lib64/dirsrv/slapd-instance_name/db2ldif -n userroot -a /tmp/userroot.ldif
    # /usr/lib64/dirsrv/slapd-instance_name/db2ldif -n backend2 -a /tmp/backend2.ldif
  2. On the new server instance, use the ldif2db utility by running the following commands:
    # /usr/lib64/dirsrv/slapd-instance_name/ldif2db -n userroot -i /tmp/userroot.ldif
    # /usr/lib64/dirsrv/slapd-instance_name/ldif2db -n backend2 -i /tmp/backend2.ldif

5.3.2. The Replication Migration Method

Note

If using the replication migration method, custom schema does not need to be manually added to the new Directory Server, replication will replicate any custom schema to the new instance.
This migration method uses replication to migrate the database to the new Directory Server instance. A benefit to this approach is that you can keep the previous server up and running while the migration process is being performed.
Once all the migration tasks are performed, you can then put the new Directory Server instance into production and decommission the previous server.

5.3.2.1. Using Replication

These steps show how to use replication to migrate your existing database to the new Directory Server instance.

Procedure 5.1. Using replication

  1. Enable replication on the new Directory Server instance.
    For detailed information on enabling replication, see the Red Hat Directory Server 9 Administration Guide.
  2. If not already done, enable replication on the Directory Server 8 instance.
  3. Create a replication on the Directory Server 8 server to point to the new Directory Server 9 instance.
  4. Initialize replication.
  5. Do this for each back end that needs to be migrated.
  6. Optionally, you can set up replication to other Directory Server 9 instances from the original Directory Server 9 instance.
After performing these steps, the Directory Server 9 instance will stay synchronized with the Directory Server 8 instance until the other Directory Server 9 instances can be put into production.