15.2.6. Step 6: Migrating Internal Databases
Migrate the internal databases of the 6.1 DRM to the 7.3 DRM internal databases by doing the following:
For more information on migrating internal databases, see Section 9.8, “Migrating Internal Databases for 6.1”.
Log into the new DRM instance server hosting server.example.com as the Certificate System user, and export the new internal database content to LDIF.
cd /opt/redhat-ds/slapd-DS-instance/db db2ldif -n server.example.com-rhpki-kra
The LDIF file location is given when the export from the database is complete.
ldif file: /opt/redhat-ds/slapd-DS-instance/ldif/2005_06_07_720658.ldif
Open the given LDIF location, and rename the LDIF file new.ldif.
cd /opt/redhat-ds/slapd-DS-instance/ldif mv 2005_06_07_720658.ldif new.ldif
For this example, since the new Certificate System migration utility was copied during the CA migration described previously, there is no need to obtain it again for the DRM migration.
Run the db2ldif command to export the database contents to LDIF.
cd /usr/netscape/servers/slapd-drm-db db2ldif -n userRoot
The location of the LDIF file is shown when the export from the database is complete.
ldif file: /usr/netscape/servers/slapd-drm-db/ldif/2005_06_07_390512.ldif
Open the given LDIF location, and rename the LDIF file old.ldif.
cd /usr/netscape/servers/slapd-drm-db/ldif mv 2005_06_07_390512.ldif old.ldif
Adjust the LDIF content of old.ldif.
For this example, the amount of data is relatively small, so any text editor work. For large files, use an appropriate program.
Convert the old.ldif file to a text file.
Open the version-to-text directory in the 6.1 migration directory.
cd /usr/netscape/servers/bin/cert/migrate/61ToTxt
Edit the run.sh script by uncommenting and setting the values for the following lines:
Run the run.sh to use the old.ldif file to create a text file.
run.sh /usr/netscape/servers/slapd-drm-db/ldif/old.ldif > /usr/netscape/servers/slapd-drm-db/ldif/old.txt
Open the 6.1 DRM LDIF directory, and copy the old.txt file to the 7.3 DRM internal database LDIF directory.
cd /usr/netscape/servers/slapd-drm-db/ldif cp /usr/netscape/servers/slapd-drm-db/ldif/old.txt /opt/redhat-ds/slapd-DS-instance/ldif/old.txt
Log into the new DRM instance server hosting server.example.com as the Certificate System user, and open the Certificate System ldif directory.
cd /opt/redhat-ds/slapd-DS-instance/ldif
Log in as root, and set the file user and group to the Certificate System user and group.
su chown pkiuser:pkiuser old.txt
Log out as root. As the Certificate System user, change the permissions on the file.
chmod 00600 old.txt
Convert the old.txt file to LDIF.
Import the old.ldif LDIF file into this new DRM server instance's internal database.