diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-05-17 16:47:55 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-05-17 16:47:55 -0700 |
commit | c12c48f47a0cdd7282950fa25e5e7548dd1c5ab0 (patch) | |
tree | 440d85d8a2032d80a7663dacf7c52f8b3cb23511 /ldap/admin/src/scripts/template-upgradednformat.in | |
parent | 5bbca6cfe1f9f1a44872d97a2c80c8cc03c19bbf (diff) | |
download | ds-c12c48f47a0cdd7282950fa25e5e7548dd1c5ab0.tar.gz ds-c12c48f47a0cdd7282950fa25e5e7548dd1c5ab0.tar.xz ds-c12c48f47a0cdd7282950fa25e5e7548dd1c5ab0.zip |
591336 - Implementing upgrade DN format tool
Change description:
. adding upgradednformat utility to each server instance.
. adding 91upgradednformat.pl for in-place-upgrade.
. implementing ldbm_back_upgradednformat sharing the import/
reincexing codes.
. adding a new DBVERSION ID "dn-4514" for the upgraded db.
. fixing access logs (delete.c and modify.c)
. fixing compiler warnings.
. fixing memory leaks.
. fixing a bug in syntax plugin to free strings.
. adding templates for plugin id, version, vendor, and description,
which are needed for the online upgrade.
. dbversion_write takes an additional bit flags, which indicates
which extra DBVERSION strings are written to the DBVERSION file.
It was introduced for the upgrade tools not to intervene each
other's tasks (e.g., dn2rdn for converting entrydn to entryrdn
and upgradednformat for upgrading the DN format).
. fixing a bug in entryrdn index code which was missing to normalize
RDN.
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=591336
http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format#Migration.2FUpgrade
Diffstat (limited to 'ldap/admin/src/scripts/template-upgradednformat.in')
-rwxr-xr-x | ldap/admin/src/scripts/template-upgradednformat.in | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/ldap/admin/src/scripts/template-upgradednformat.in b/ldap/admin/src/scripts/template-upgradednformat.in new file mode 100755 index 00000000..ea4f18a4 --- /dev/null +++ b/ldap/admin/src/scripts/template-upgradednformat.in @@ -0,0 +1,56 @@ +#!/bin/sh + +# upgradednformat -- upgrade DN format to the new style (RFC 4514) +# Usgae: upgradednformat [-N] -n backend_instance -a db_instance_directory +# -N: dryrun +# exit code: 0 -- needs upgrade; 1 -- no need to upgrade; -1 -- error +# -n backend_instance -- instance name to be examined or upgraded +# -a db_instance_directory -- full path to the db instance dir +# e.g., /var/lib/dirsrv/slapd-ID/db/userRoot +prefix="{{DS-ROOT}}" +if [ "$prefix" = "/" ] ; then + prefix="" +fi +LD_LIBRARY_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@libdir@:$prefix@pcre_libdir@ +if [ -n "$prefix" ] ; then + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@nss_libdir@" +fi +export LD_LIBRARY_PATH +SHLIB_PATH=$LD_LIBRARY_PATH +export SHLIB_PATH + +cd {{SERVERBIN-DIR}} + +dir="" +be="" +dryrun=0 +while [ "$1" != "" ] +do + if [ "$1" = "-a" ]; then + shift + dir="$1" + elif [ "$1" = "-n" ]; then + shift + be="$1" + elif [ "$1" = "-N" ]; then + dryrun=1 + fi + if [ "$1" != "" ]; then + shift + fi +done + +if [ "$be" = "" ] || [ "$dir" = "" ]; then + echo "be: $be" + echo "dir: $dir" + echo "Usage: $0 [-N] -n backend_instance -a db_instance_directory" + exit 1 +fi + +if [ $dryrun -eq 0 ]; then + ./ns-slapd upgradednformat -D {{CONFIG-DIR}} -a $dir -n $be +else + ./ns-slapd upgradednformat -D {{CONFIG-DIR}} -a $dir -n $be -N +fi +rc=$? +exit $rc |