summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2007-09-14 21:24:12 +0000
committerRich Megginson <rmeggins@redhat.com>2007-09-14 21:24:12 +0000
commit668cbe6b64782a7d3e5a4c14b88945efab861233 (patch)
treed571b0b1ee860238ef2128d846532fb23c69bfdb /ldap/admin/src
parent75f917e168ecfb204a92662579dac32ce959898b (diff)
downloadds-668cbe6b64782a7d3e5a4c14b88945efab861233.tar.gz
ds-668cbe6b64782a7d3e5a4c14b88945efab861233.tar.xz
ds-668cbe6b64782a7d3e5a4c14b88945efab861233.zip
Resolves: bug 288451
Bug Description: Show-Stopper - Migration from HP-PARISC DS 6.21 to DS80 on HP-Itaninum Reviewed by: nhosoi (Thanks!) Fix Description: These are additional fixes for various and sundry problems: 1) If doing cross platform migration, just use the default db and changelog db dirs 2) If doing same platform migration, try to keep the db dir if the user has changed it. It will usually be changed for a good reason, like moving to a separate device for performance reasons. In order to see if the directory has changed, we need to "normalize" the path in the attribute so that we can compare it correctly. 3) Do not migrate the attributes nsslapd-db-private-import-mem and nsslapd-import-cache-autosize - just use the new default values for these 4) Do not migrate nsslapd-allidsthreshold - this has been removed 5) Add additional error checking and handling when migrating the local.conf information. 6) Change the brand in the sie and isie when migrating. 7) Update the Group in console.conf during migration. Platforms tested: HP-UX 11.23 IPF64 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Diffstat (limited to 'ldap/admin/src')
-rw-r--r--ldap/admin/src/scripts/DSMigration.pm.in28
1 files changed, 21 insertions, 7 deletions
diff --git a/ldap/admin/src/scripts/DSMigration.pm.in b/ldap/admin/src/scripts/DSMigration.pm.in
index 089f4121..fa220a7b 100644
--- a/ldap/admin/src/scripts/DSMigration.pm.in
+++ b/ldap/admin/src/scripts/DSMigration.pm.in
@@ -56,6 +56,9 @@ use DSCreate;
use File::Temp qw(tempfile tempdir);
use File::Basename qw(basename);
+# absolute path handling
+use Cwd qw(realpath);
+
# load perldap
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Utils qw(normalizeDN);
@@ -104,7 +107,14 @@ my %ignoreOld =
'nsslapd-ldapigidnumbertype' => 'nsslapd-ldapigidnumbertype',
'nsslapd-ldapientrysearchbase' => 'nsslapd-ldapientrysearchbase',
'nsslapd-ldapiautodnsuffix' => 'nsslapd-ldapiautodnsuffix',
- 'numsubordinates' => 'numSubordinates'
+ 'numsubordinates' => 'numSubordinates',
+ # for these, we just want to use the default values, even if they were
+ # set in 7.1 or later
+ 'nsslapd-db-private-import-mem' => 'nsslapd-db-private-import-mem',
+ 'nsslapd-import-cache-autosize' => 'nsslapd-import-cache-autosize',
+ # nsslapd-allidsthreshold does not exist anymore
+ # the analogous concept is nsslapd-idlistscanlimit for searches
+ 'nsslapd-allidsthreshold' => 'nsslapd-allidsthreshold'
);
# these are the obsolete entries we do not migrate
@@ -126,19 +136,23 @@ my %alwaysUseOld =
sub getNewDbDir {
my ($ent, $attr, $mig, $inst) = @_;
+ my $newval;
my %objclasses = map { lc($_) => $_ } $ent->getValues('objectclass');
my $cn = $ent->getValues('cn');
- my $oldval = $ent->getValues($attr);
- my $newval;
# there is one case where we want to just use the existing db directory
# that's the case where the user has moved the indexes and/or the
# transaction logs to different partitions for performance
# in that case, the old directory will not be the same as the default,
# and the directory will exist
- my $olddefault = "$mig->{actualsroot}/$inst";
- if (-d $oldval and ($oldval !~ /^$olddefault/)) {
- debug(2, "Keeping old value [$oldval] for attr $attr in entry ", $ent->getDN(), "\n");
- return $oldval;
+ # for cross platform, we should just use the new default location
+ if (!$mig->{crossplatform}) {
+ my $oldval = $ent->getValues($attr);
+ my $absoldval = realpath($oldval) || $oldval;
+ my $olddefault = "$mig->{actualsroot}/$inst";
+ if (-d $absoldval and ($absoldval !~ /^$olddefault/)) {
+ debug(2, "Keeping old value [$absoldval] for attr $attr in entry ", $ent->getDN(), "\n");
+ return $oldval;
+ }
}
# otherwise, just use the new default locations
if ("@with_fhs_opt@") {